News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Is there any way to put resource section as the last section?

Started by Dubby, June 21, 2012, 11:30:43 PM

Previous topic - Next topic

Dubby

So as the title says...
is there any linker directive to do so?

because sometimes I feel lazy to update resources through the source code...
especially, if I just want a quick dirty hack for resource layout inside my assembled program...  :P

Vortex

Hi Dubby,

Not sure if it helps but, you can try Yaroslav's resource linker :

http://c--sphinx.narod.ru/indexe.htm

Vortex

Here is a quick example :

#include    "Dlgbox.inc"

.data
DlgName     db "MyDialog",0

hInstance   dd ?
CommandLine dd ?
hCursor     dd ?

.code

start:

    invoke  GetModuleHandle,0
    mov     [hInstance],eax
    invoke  DialogBoxParam,[hInstance],ADDR DlgName,0,ADDR DlgProc,0
    invoke  ExitProcess,eax

DlgProc FRAME hWnd,uMsg,wParam,lParam

    cmp     d[uMsg],WM_CLOSE
    jne     >initdlg
    invoke  EndDialog,[hWnd],0
    jmp     >true

initdlg:

    cmp     d[uMsg],WM_INITDIALOG
    jne     >setcursor
    invoke  LoadCursor,0,IDC_CROSS
    mov     [hCursor],eax
    jmp     >true

setcursor:

    cmp     d[uMsg],WM_SETCURSOR
    jne     >false
    invoke  SetCursor,[hCursor]
    jmp     >true

false:

    xor     eax,eax
    ret

true:

    mov     eax,1
    ret

ENDF


\goasm\gorc /r rsrc.rc

\goasm\goasm Dlgbox.asm
\goasm\golink Dlgbox.obj kernel32.dll user32.dll

rl.com Dlgbox.exe rsrc.res /a

Dubby

Thanks alot Vortex...
but looks like it's only work on x86 platform only....

but anyway thanks for the link....  :biggrin:

Vortex

Not sure but it would be interesting to try a tool like Resource Hacker to accomplish the task.