Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem:adding a menu (windows programming)

Status
Not open for further replies.

liyan

Programmer
Nov 15, 2000
1
BE
I've got a win32-application and I want to add a menu to my scene.(I work with
OpenGL). I add my cpp-file and my rc-file to my project.
In my cpp-file you can find :
in my function CreateGLWindow() I wrote :
wc.lpszMenuName = "MyMenu";
...
HMENU = hMenu;
hMenu = LoadMenu(hInstance,"MyMenu");
hWnd = CreateWindowEx(...,hMenu,hInstance,NULL);
When I execute my program I only see my scene but there is no menu.
What did I do wrong?
 
Dear liyan,

> HMENU = hMenu;

That should not even compile.

> hMenu = LoadMenu(hInstance, "MyMenu");

Do you check the value of hMenu after this?

Also you might try making 'hMenu' an application lifetime scope variable.

Good luck
-pete
 
Pete, how do you make an application lifetime scope variable? I know how to make a global variable for the whole .cpp file. Is there a way to make a variable that will be able to be used throughout the ENTIRE project over multiple .cpp files?

Sorry, I know this isn't really pertaining to this subject, but I just had to know. Thanks for understanding!

Niky Williams
NTS Marketing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top