|
|
Yeah, but that's about the menu not disappearing when we shift focus to some other window.
It does not say that you cant change the menu item text anywhere
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
|
Colin
You need to make some changes
First open up SystemTray.cpp
scroll down to CSystemTray::OnTrayNotification
You'll see the following line at the beginning of the function [3rd or 4th line]
CWnd *pTargetWnd = GetTargetWnd();
Comment that out and replace the line with this line :-
CWnd *pTargetWnd = AfxGetApp()->m_pMainWnd;
Okay, so far?
Now add a new public function to the class as follows
void CSystemTray::ChangeMenuText()
{
CMenu menu, *pSubMenu;
pSubMenu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(0);
if (!pSubMenu)
return ;
pSubMenu->ModifyMenu(2,MF_BYPOSITION,2,"YYYYYYYYYYYYY");
}
Okay???
Now in your main dlg class do this to the OnMenuSend:-
void CNishTestDlg::OnMenuSend()
{
// TODO: Add your command handler code here
m_TrayIcon.ChangeMenuText();
AfxMessageBox("Send");
}
Now run the program.
When you click on send once you'll change it to YYYYY
Happy, now???
Cheers
Nish
p.s. I messed up the project here. so I cant send it to you. After it was workin properly I messed it up
But if you want it badly I can send you one quicklymade up project.
p.s. to p.s :- you sure chris and mike will like newbies like colin and nish messin up their cool tray-icon class??
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Hi Nish,
Thanks for your efforts !
I actually understand the changes you are making !
But I made them and the system_tray changes still don't take effect although the dialog's menu does change !
Do you want me to re-send you the Zip!
Regardz
Colin J Davies
Sonork ID 100.9197:ColinI live in Bob's HungOut now
Click here for free technical assistance!
|
|
|
|
|
Well, I am home right now. I prolly have the zip in the deleted-items OE folder
I'll send you a project tomorrow morning unless my PM comes and sits near me and discusses some stuff
Nish
p.s. you sure you did everything exactly as I wrote? It worked for me.
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Okay
chk your mail
I've send a working project zipped
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I'm attempting to add scrollbar to a tab pane containing a number of comboboxes and text boxes. Some of the text boxes fall off the bottom of the pane and I would like to be able to scroll down and see them rather than having to re-size the form.
I have managed to add a scrollbar to the tab (ModifyStyle(0, WS_VSCROLL)) but have been unsucessful in getting the scrollbar to work, or infact do anything.
I would appreciate any sugggestion as I have never tried using scrollbars in C++ before.
Thank you all (in advance).
|
|
|
|
|
Hello everybody,
I use hotkey edit control, and i want to convert the return value in text mode like the edit control ( Ctrl+Alt+A ... )
Some else know the function or the routine to convert the return value in text???
Oh, sorry for my english.
thanks in advance
Fred.
|
|
|
|
|
Hi,
For some reason the error strings returned from my CRecordset derived class are in German. I am connecting to the datasource using a CDatabase class which connects using the path (DBQ) of the database (access MDB). I then instatiate my CRecordset derived class using the new operator and passing the CDatabase instance. The connection fails and the error code is in german.
Anyone know why this is and what I can do to fix it?
James Spibey
I love the word naked, it's brilliant isn't it, 'naked'. When I was a kid I used to write the word naked on a bit of paper hundreds of times and rub my face in it - Jeff, Coupling, BBC2
|
|
|
|
|
I guess you have specified German language version of driver for MS Access. Select English one and it should be OK.
Martin
|
|
|
|
|
In my work,I have to use the class in the DLL.The DLL is compilered by Borland C++.I have tried my best to do,but each time I have been failed.
What should I do? Now I am doubted whether VC can use the class exporting by other compiler.
If anyone know VC can do it,please tell me how to do it! You can revert or mail: wenxiaoxiao97@mails.tsinghua.edu.cn
Thank you very much!
I am glad to make friends with all of you!
My email is
wenxiaoxiao97@mails.tsinghua.edu.cn
Please mail me.
|
|
|
|
|
The import library produced by MS Visual C++ is in COFF format (Mangled Names), and Delphi and Borland C++ expects things in OMF format.
See the July 1996 "Under the Hood" article of Microsoft Systems Journal. It talks about different dll formats and ways to get round this.
|
|
|
|
|
i have got a problem.. i made an exe - server with atl. if i run it on my or my coworkers pc everything works fine. our atl.dll was added in 1999. if we run our server on a pc with the atl.dll added in 2000 it doesn't work, cause he can't find an entry.. #57 )
we are all using win nt4, and we all have got the same sp (as far as i know)..
do i have to install the latest platform skd, or what could be the problem ?
thanks in advance,
bernhard
"There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou
|
|
|
|
|
A Workaround would be to statically link ATL.DLL so it is not required.
1. Open the Project Settings dialog box, select the C++ tab. In the Preprocessor Definitions text box, replace _ATL_DLL with _ATL_STATIC_REGISTRY.
2. Recompile.
If the project has been created using the ATL AppWizard, you only need to select the Win32 Release MinDependency option, which has the correct preprocessor definitions for statically linking to the registrar code.
|
|
|
|
|
thank you.. now it works great..
bernhard
"There are three roads to ruin: women, gambling and technicians. The most pleasant is with women, the quickest is with gambling, but the surest is with technicians." Georges Pompidou
|
|
|
|
|
Hi!
MFC have defined their own new, which I found very useful. It prints out if you have some memory leaks when the program exists. In my project, I can't link with the MFC libs since they contain a Dllmain and I have one too.
I tried to create my own new, and that wasn't any problem. Only give som extra arguments through a define. But I must also create a delete. I thought that the delete operator with equal arguments as the new operator, except for vooid * instead of sizt_t, would be called. But instead the global new is called all the time!
I even tried to copy the MFC-way, but still the original global operator new is called!
Anyone who knows?
//Olof Wolgast
|
|
|
|
|
Dear all:
Is anybody here know how could I serialize all elements in a STL container using MFC's serialization and dynamic creation mechanism?
Thank you.
|
|
|
|
|
Write the number of elements first, then iterate through the container to write them. The element count tells you how many to read in when you load.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Thank you Christian. But what you said has only covered Write activity, when you do Read activity, you must new all kinds of objects out and add them into the collection, say a vector.
And more, I need to write my own Archive class and overload the >> and << operator.
Have you got any idea of this?
I'm sure somebody has finished it, but I don't know how to find it.
|
|
|
|
|
That depends on if you have a vector of pointers. If you do, you obviously need to dereference them in writing, and recreate them with new when you push them on to the container.
Why do you need your own archive class ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Because STL doesn't has a built-in file stream class.
Also, what about the dynamic creation mechanism?
|
|
|
|
|
I was presuming you were using the Serialise method of a CDocument derived class, and iterating through your data, writing it out there.
What do you mean by dynamic creation ?
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
When you deserialize the object, the object's default ctor will be called up to create a object.;)
|
|
|
|
|
That's what I thought you meant - that's why I suggested writing the count first, then writing out the items, so you can get the CONTENTs of the vector back from the archive and construct the vector yourself.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|