How can insert menu to dialog by ce application?
-
How can insert menu to dialog by ce application?
CMenu m_menu;
m_menu.LoadMenuW(IDR_MENU_MAIN);
CMyCEApplicationDlg dlg;
m_pMainWnd = &dlg;dlg.SetMenu(&m_menu);
RunTime the code "dlg.SetMenu(&m_menu);" is error.
-
How can insert menu to dialog by ce application?
CMenu m_menu;
m_menu.LoadMenuW(IDR_MENU_MAIN);
CMyCEApplicationDlg dlg;
m_pMainWnd = &dlg;dlg.SetMenu(&m_menu);
RunTime the code "dlg.SetMenu(&m_menu);" is error.
i already find the reason, beacause
"
m_menu.LoadMenuW(IDR_MENU);dlg.SetMenu(&m_menu);
"should be put in Dialog InitDialog method;
-
i already find the reason, beacause
"
m_menu.LoadMenuW(IDR_MENU);dlg.SetMenu(&m_menu);
"should be put in Dialog InitDialog method;
It is a good practice to check return value of functions like LoadMenu() to know if the call is succeeded or not.