|
Hello,
Yes I have 6 as the id of the menu item
I have tried
EnableMenuItem(6, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
But that did not work
Thanks
Prithaa
|
|
|
|
|
Use this
and
Set the m_bAutoMenuEnable to FALSE in the constructor of
CMainFrame so no ON_UPDATE_COMMAND_UI or ON_COMMAND handlers are
needed.
|
|
|
|
|
prithaa wrote: I have a CMenu class object with some menu options
If it's an MFC app then you should use ON_UPDATE_COMMAND_UI macro and handle disabling and enabling there.
|
|
|
|
|
Hello,
Thanks,
I am not using Doc-View architecture.Yes I am using MFC's in my app.
I am handling enabling disabling in OnCmdMsg() of Mainframe class
Bye.
|
|
|
|
|
prithaa wrote: I am handling enabling disabling in OnCmdMsg() of Mainframe class
If you have done the OnCmdMsg as I said earlier, to disable the menu you need to return FALSE from that funtion.
|
|
|
|
|
Naveen.R wrote: If you have done the OnCmdMsg as I said earlier
Is this the correct way? ON_UPDATE_COMMAND_UI macro is provided for this purpose right.
|
|
|
|
|
When I checked the ON_UPDATE_COMMAND_UI wasn't arriving..
Please try.
Create a menu dynamically
Set it to mainframe using the SetMenu().
Now the menu will be disbaled since it dosent have command handler.
So I stepped into the MFC code and found out that handling the OnCMdMsg() will solve the pblm( I forget what you said in the IPT class ).
Please check the ON_UPDATE_COMMAND_UI is coming in this case.
|
|
|
|
|
Hello All,
I have to register a DLL which is builded in .NET with C#.
and i have to call exported function from VC++ project.
so for i have to register that DLL so please tell me how it is possible?
Thanks
bankey
|
|
|
|
|
|
Thanks for ur response.
i am allready trying using regasm it shows only registered successfully but in actual it is not registering.
may be there is version or other problem because when i build DLL using C# on my machine itself than it is working properly but when i got that DLL which is builded on other machine that it is not registering so what is happening i am unable to understand
|
|
|
|
|
I created a Setup with Visual Studio and all works nice.
I like to start the application automatically after the setup is closed.
(probably add a new page with the demand to open the app or not )
Has anyone an idea how to start it?
Big thanks
|
|
|
|
|
|
Hi
Any body know any articles or ebooks that explains VC++ for beginers ?
|
|
|
|
|
|
http://www.functionx.com
Anurag Gandhi.
|
|
|
|
|
Hi all:
I have a modeless dialog in which I have done not much inside its OnPaint, but when this dialog overlapped randomly, this dialog appears out of shape on the surface, should I send WM_PAINT or WM_ERASEBKGND message, if so when should I send them?
|
|
|
|
|
If you draw something directly on the dialog, all the drawing code should be put in the OnPaint handler. The dialog doesn't "keep" the drawing for you but you have to redraw everything again in the OnPaint handler.
Is that your problem ? If no, then I misunderstood your question.
|
|
|
|
|
Cedric Moonen wrote: redraw everything again in the OnPaint handler
I probably miss state the situation, on OnPaint I only call the DrawText, other than that I done nothing else, system handle all the rest paint operations.
|
|
|
|
|
it depends on what you exactly do. A repaint makes than sence, when all GUI changes are done.
It is also common style to update only some controls. For instance a status bitmap.
It makes also sence to divide forground and background painting.
Greetings from Germany
|
|
|
|
|
Maybe you have to post more clearly your problem.
Anyway, don't send WM_PAINT directly,
use instead InvalidateRect and UpdateWindow functions.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi
i am making a app.. in vc++ how we upload a doc file in mysql database
selecting data from local hard disk
Regard's
Kaushik
|
|
|
|
|
Where are you in the process of doing it? What have you tried and accomplished?
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
i can browse hard disk and read the name of file
but i am unable to upload file in database
Regard's
Kaushik
|
|
|
|
|
What type of field in your database will hold said file? Are you able to assign values to other fields?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm developing an application. The code can run naturally. But after I rebuild all code, the code happened an exception numbered 'C0000005' in the CDialog::OnInitDialog(). I spent several hours to find the reason. But none found. Is there someone can give me some tips?Thxs.
|
|
|
|