When the window is registered it defaults to the ID_MMENU.
And I've defined mmenu and picmenu each as HMENU right under the LRESULT CALLBACK, under switch (message), under case WM_COMMAND:, and under switch (wParam). And I've defined hThisInstance as an HINSTANCE under the things I mentioned before.
(hwnd is my parent window.)
And yes, ID_MMENU and ID_PICMENU are defined correctly.
I'm just trying to be specific because a lot of people ask "Well, did you do this?" and I'm like "Yes I did that" and I don't get anywhere.
I've also tried using the case statements OUTSIDE the case WM_COMMAND: statement but it still doesn't work.
But whenever I click on my menuitems Show Music and Show Pictures, the menu disappears and it won't come back until I restart the program. Yes, I've done a forum search. If anyone can help would you please say what I'm doing wrong and post the right code here, please don't give me links to websites that you think will help me because they usually don't work for me in Dev C++.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-11-25
LoadMenu()returns NULL on error, with GetLastError() providing extended error information. You should check these, if the handle is invalid presumably SetMenu() will do nothing other than remove the previous menu. The extended error information may provide a clue as to what the problem is.
> And yes, ID_MMENU and ID_PICMENU are defined correctly.
> I'm just trying to be specific because a lot of people ask
> "Well, did you do this?" and I'm like "Yes I did that" and
> I don't get anywhere.
Did you ever consider why that is!? That is not being specific that is asking people to take it on trust that you know what you are doing, but whatever it is you are doing does not work, so why should they? Generally rather than stating "yes I've done it right", you should show you have done it right by posting what you have done. To be honest, copy & pasting what you have is far easier that trying to describe it!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm trying to load multiple menus in my program; like using "case", when this happens load this menu, and so on... This is the code I am using:
When the window is registered it defaults to the ID_MMENU.
And I've defined mmenu and picmenu each as HMENU right under the LRESULT CALLBACK, under switch (message), under case WM_COMMAND:, and under switch (wParam). And I've defined hThisInstance as an HINSTANCE under the things I mentioned before.
(hwnd is my parent window.)
And yes, ID_MMENU and ID_PICMENU are defined correctly.
I'm just trying to be specific because a lot of people ask "Well, did you do this?" and I'm like "Yes I did that" and I don't get anywhere.
I've also tried using the case statements OUTSIDE the case WM_COMMAND: statement but it still doesn't work.
But whenever I click on my menuitems Show Music and Show Pictures, the menu disappears and it won't come back until I restart the program. Yes, I've done a forum search. If anyone can help would you please say what I'm doing wrong and post the right code here, please don't give me links to websites that you think will help me because they usually don't work for me in Dev C++.
LoadMenu()returns NULL on error, with GetLastError() providing extended error information. You should check these, if the handle is invalid presumably SetMenu() will do nothing other than remove the previous menu. The extended error information may provide a clue as to what the problem is.
http://msdn2.microsoft.com/En-US/library/ms647990.aspx
> And yes, ID_MMENU and ID_PICMENU are defined correctly.
> I'm just trying to be specific because a lot of people ask
> "Well, did you do this?" and I'm like "Yes I did that" and
> I don't get anywhere.
Did you ever consider why that is!? That is not being specific that is asking people to take it on trust that you know what you are doing, but whatever it is you are doing does not work, so why should they? Generally rather than stating "yes I've done it right", you should show you have done it right by posting what you have done. To be honest, copy & pasting what you have is far easier that trying to describe it!
Clifford