win32 menus using resource scripts with dev-C++

Started by
2 comments, last by neilp85 18 years, 3 months ago
I'm using dev-C++ and can't get a simple menu I made with a resource script to appear when the program is executed. The icons are working just fine but there is no menu created. I've looked through several different tutorials and haven't gotten any of the different ways I've seen to work. Here is what I've tried using the two resource files that follow: // the menu doesn't appear with either of these wc.lpszMenuName = (LPSTR)LoadMenu(hThisInstance,MAKEINTRESOURCE(IDR_MYMENU)); wc.lpszMenuName = MAKEINTRESOURCE(IDR_MYMENU); // this way doesn't even compile wc.lpszMenuName = LoadMenu(hThisInstance,MAKEINTRESOURCE(IDR_MYMENU)); //resource.h #define IDR_MYMENU 101 #define IDI_MYICON 201 #define ID_FILE_EXIT 4001 //resource.rc #include "resource.h" IDI_MYICON ICON "src/my_icon.ico" IDR_MYMENU MENU BEGIN POPUP "&File" BEGIN MENUITEM "E&xit", ID_FILE_EXIT END END I've also tried each of these ways using the IDR_MYMENU identifier as a string instead of a numeric constant but that didn't work either. Could someone please help me out.
Advertisement
Try not assigning anything to the WNDCLASSEX::lpszMenuName field and just call LoadMenu() and SetMenu().
this should also be called during the windows creation in the wnd proc.
Bring more Pain
Thanks for the help, I got it working now

This topic is closed to new replies.

Advertisement