Author Topic: resource code  (Read 8170 times)

Vortex

  • Member
  • *****
  • Posts: 1989
Re: resource code
« Reply #15 on: July 04, 2014, 05:35:06 AM »
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

  • Member
  • ****
  • Posts: 833
Re: resource code
« Reply #16 on: July 04, 2014, 06:28:46 AM »
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

  • Member
  • **
  • Posts: 207
    • WJR's website
Re: resource code
« Reply #17 on: July 04, 2014, 09:13:37 AM »
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

  • Member
  • ****
  • Posts: 833
Re: resource code
« Reply #18 on: July 04, 2014, 11:03:11 AM »
      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

  • Member
  • **
  • Posts: 207
    • WJR's website
Re: resource code
« Reply #19 on: July 04, 2014, 12:09:08 PM »
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

  • Member
  • ****
  • Posts: 833
Re: resource code
« Reply #20 on: July 04, 2014, 04:30:23 PM »
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.