Recommended Posts

Share on other sites
According to MSDN, SetMenu() should cause the Window to be redrawn to reflect the change, so that should work.

Just a thought.

Menu = LoadMenu (hInstance, MAKEINTRESOURCE(IDR_MENU));if(Menu==NULL) MessageBox(Window,"Here's the problem","",MB_OK);SetMenu (Window, Menu);

Share on other sites
the error check worked and said it failed to create the menu. so how can I fix it?
It also fails to create the popup menu.

Share on other sites

a) Post your resource file (.rc). Perhaps there is an error in there.
b) Are you sure the resource file (.rc) is being compiled into the .res file?
c) Are you sure the .res file is being linked to the exe? What compiler/IDE are you using?

Share on other sites
okay heres my resource script;

#include "resource.hpp"

BEGIN
POPUP "&File"
BEGIN
END
POPUP "&Drawing"
BEGIN
, CHECKED
END
END

BEGIN
POPUP "popup"
BEGIN
END
END

also I'm using the devC++ IDE

[Edited by - namingway on December 12, 2006 6:45:08 PM]

Share on other sites
Looks fine to me. My guess is that the resource compiler isn't being invoked correctly or the .res file isn't being linked to your application. The only other possibility I can think of is that your hInstance is invalid, but that doesn't seem very likely.

I'm not familiar with DevC++, but I'm sure someone else here will know how to compile and link Windows resources with it.

If all else fails, you could always download Visual C++ Express. Compiling and linking resources is very easy with that.

Sorry I can't be of more help.

Share on other sites
Well I installed Visual C++ and it doesnt have any of the windows headers so it wont compile..

Share on other sites
VS Express doesn't automatically come with the Platform SDK. You need to install it by following these instructions very carefully.

Create an account

Register a new account

• Forum Statistics

• Total Topics
627708
• Total Posts
2978730

• 21
• 14
• 12
• 22
• 35