Menu Problem :(
For my simple map editor i wanted to make my menu using the VC++ 6.0 resource editor. Well at flipcode it said to make the menu which i did. Its name is IDR_MENU. Then where you setup the window class you have to put wc.lpszMenuName = MAKEINTRESOURCE(IDR_MENU); Well flipcode says that will work but im getting an error saying IDR_MENU is an undeclared identifier. How is this possible when i just created this resource and named it IDR_MENU. Is there something i need to include or something?
Snyper
=============================Where's the 'any' key?=============================
First, check to make sure that you put in LoadMenu(hinstance, "MenuName") in CreateWindowEx (if you''re using CreateWindowEx). If not, try this. Set the menu name to NULL when you are setting up the window parameters, then set the menu name to NULL when you create the window. After you''ve done this enter the lines:
HMENU hmenuhandle = LoadMenu(hinstance, "MenuName");
SetMenu(hwnd, hmenuhandle);
That should work (at least it does for me).
HMENU hmenuhandle = LoadMenu(hinstance, "MenuName");
SetMenu(hwnd, hmenuhandle);
That should work (at least it does for me).
September 25, 2000 10:41 PM
VC++ ought to be generating a header file called resource.h containing a bunch of defines, one of which should look something like #define IDR_MENU 101. This header has to be included in your main source .cpp file.
If VC++ isn''t generating that file, then that''s probably due to the settings you chose when you created the project. You can probably make it yourself by opening a header file, writing #define IDR_MENU 101
//any other defines (for menu IDs like ID_FILE_NEW, etc.)
saving it, and including it.
Or you could get VC++ to generate it for you (probably the safest way) by making a new project that is MFC-enabled. In such a project, the first time you make a resource, the file header file resource.h should automatically be created w/ all the requisite defines. If you''re already in an MFC project and that''s happening, then I have no idea
hope some of that helped.
If VC++ isn''t generating that file, then that''s probably due to the settings you chose when you created the project. You can probably make it yourself by opening a header file, writing #define IDR_MENU 101
//any other defines (for menu IDs like ID_FILE_NEW, etc.)
saving it, and including it.
Or you could get VC++ to generate it for you (probably the safest way) by making a new project that is MFC-enabled. In such a project, the first time you make a resource, the file header file resource.h should automatically be created w/ all the requisite defines. If you''re already in an MFC project and that''s happening, then I have no idea
hope some of that helped.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement