Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
How can i load a menu (from resource id) into dialog base app, without use resource editor (with code)?
:doh:
Posted

1 solution

Add a CMenu member on your dialog class, then in its OnInitDialog add the code below:

C++
m_menu.LoadMenu(IDM_MYMENU);
SetMenu(&m_menu);
 
Share this answer
 
Comments
mohammadmot 3-Nov-10 10:04am    
Thanks, ok it's work.
i had this error:
before LoadMenu i call CreateMenu and it's make error.
Solved my problem
Nish Nishant 3-Nov-10 10:09am    
What's the error you get?
Nish Nishant 3-Nov-10 10:10am    
Btw since the menu resource already exists, you don't need to call CreateMenu, just use the code Viti gave you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900