I was just looking through my win32 api reference and
i found the LoadMenu and SetMenu functions, now i wanned
to show a menu - i specified it in my resource - in my modal dialog
so i put the functions under
WM_INITDIALOG
like this:
invoke LoadMenu,hDlg,CalcMenu
invoke SetMenu,hDlg,eax
LoadMenu gives the returnvalue (the Menu Handle) in eax
i also tried this:
.data
MenuName db "CalcMenu",0
.
.
.code
invoke LoadMenu,hDlg,addr MenuName
invoke SetMenu,hDlg,eax
both doesn't work
Regards Typhoon
Your error is classic: it happens to all beginners to the art of Windows programming. You confuse between dialog/window handle and instance handle. They are not the same thing. A dialog handle represents a dialog box while an instance handle represents the whole process. In your LoadMenu line, you use hDlg instead of hInstance.
Thanks Iczelion,
i just learned a little more, :)
regards