Have made an attempt with the following steps, no menu shows yet
1. Created a resource file (in Using VS 2005)
- Went to Project Properties, Add > New > Resource File and named it Menu.rct (note, in VS2005 is rct not rc)
- Added the menu (no code was required in VS 2005)
unlike earlier version (i.e)
...and gave ID of IDR_MAINMENUCode:#include "resource.h" IDM_MENU MENU BEGIN POPUP "&File" { MENUITEM "E&xit", ID_FILE_EXIT } POPUP "&Edit" { MENUITEM "Copy",ID_EDIT_COPY } POPUP "&Help" { MENUITEM "&About", ID_HELP_ABOUT } END
2. Edited CreateWindowEx()
3. Added a resource.h fileCode:wcx.lpszMenuName = MAKEINTRESOURCE(IDR_MAINMENU);
4. WM_COMMANDCode:#define IDR_MAINMENU 102 #define ID_FILE_EXIT 40001 #define ID_FILE_OPEN 40002 #define ID_FILE_SAVEAS 40003 #define ID_FILE_NEW 40004 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 103 #define _APS_NEXT_COMMAND_VALUE 40005 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
Is there anything am missing somewhere?Code:case ID_FILE_EXIT: { PostMessage(hwnd, WM_CLOSE, 0, 0); break; } case ID_FILE_NEW: { //ClearEditControls(hwnd, IDC_MAIN_EDIT, ""); break; } case ID_FILE_OPEN: { // Load data from file to edit controls DoFileOpen(hwnd); SetValues(hwnd, &indata); break; } case ID_FILE_SAVEAS: { // Save data on edit controls to file DoFileSave(hwnd); break; }



LinkBack URL
About LinkBacks



