News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

resource code

Started by shankle, July 02, 2014, 09:36:36 AM

Previous topic - Next topic

Vortex

Hi shankle,

You start Pelle's IDE and follow this path : File -> New -> Resources Now, right click untitled and select the resource type from the menu.

shankle

Hi Vortex,
I tried to follow your instructions but they didn't work for me.
Running Windows 7 pro 64-bit.
Didn't see any major heading "IDE"
Saw IDE for translations only.
Thanks

wjr

The first line of your resource file should be as follows to correspond to the value that you defined in your asm file:

#define ID_MENU_MAIN 600

shankle

      7-3-2014
Now there are NO GoRc errors.
BUT no items are showing on the screen such as: cut, copy, paste etc..... 

; resbatch
Set INCLUDE= J:\codejps
Set PATH=J:\codejps
GoAsm /x64/b/c blah1.asm
GoRC /machine x64 /r resfile.rc
GoLink /unused blah1.obj resfile.res

#define ID_MENU_MAIN 600
#define IDM_CUT 1101
#define IDM_COPY 1102
#define IDM_PASTE 1103
#define IDM_FIND 1104
#define IDM_UNDO 1105
#define IDM_EXIT 1010
    ID_MENU_MAIN MENUEX MOVEABLE IMPURE LOADONCALL DISCARDABLE
    BEGIN
      POPUP "&File", , , 0
      BEGIN
      MENUITEM "&Exit", IDM_EXIT
      END   
      POPUP "&Edit", , , 0
      BEGIN           
      MENUITEM "C&ut", IDM_CUT
      MENUITEM "COPY", IDM_COPY
      MENUITEM "PASTE", IDM_PASTE
      MENUITEM "&FIND", IDM_FIND
      MENUITEM "UNDO", IDM_UNDO     
      END
   END
   
Changes in the 64-bit res usage program
resfile          db   'resfile.rc',0

.const
ID_MENU_MAIN equ 600
IDM_CUT      equ 1101
IDM_COPY     equ 1102
IDM_PASTE    equ 1103
IDM_FIND     equ 1104
IDM_UNDO     equ 1105
IDM_EXIT     equ 1010
IDOK         equ 1
IDCANCEL     equ 2

   mov   Q[ovl.lpszMenuName],offset resfile

    invoke LoadMenu, [hInst],[resfile]   
    invoke SetMenu, [hWnd],rax
    invoke GetSubMenu, rax,0
    mov Q[hMenu],rax

WinMain:
    FRAME hInst,hPrevInst,CmdLine,CmdShow
   LOCAL ovl:WNDCLASSEX,msg,RR:RECT,hWndEX
    Local ps:PAINTSTRUCT,hBrush,hdc,hMenu

WndProc:
    FRAME hWnd,iMsg,wParam,lParam
    LOCAL ovl:WNDCLASSEX,hInst,hMenu
    Local hdc
   

wjr

In the asm file I don't think you need the resfile line anymore. Changing to the following lines should do it:

mov   Q[ovl.lpszMenuName], ID_MENU_MAIN

invoke LoadMenu, [hInst], ID_MENU_MAIN

shankle

To WJR,
I made the changes you suggested and it did not work.

Changed Q[ovl.lpszMenuName],600  - SUCESS.

Thanks everyone for all your help.
I had a tad of trouble with this one.