[Question] Loading resources from a .res file?

Started by xanatose, January 30, 2009, 02:38:50 AM

Previous topic - Next topic

xanatose

Is there any example of doing this? I want to share resources (dialogs, icons, etc.) between 2 versions of the same application (32bit and 64 bit).



Tedd

You could try linking the resources into a DLL, and then each program uses that DLL.
No snowflake in an avalanche feels responsible.

Vortex

You can do that with assemblers supporting the INCBIN statement reading data from files.

Vortex

Here is a Jwasm example loading resources from .res files :

EMPTY_RSRC_SECT equ 32
RSRC_ENTRY      equ 32
RSRC_OFFSET     equ EMPTY_RSRC_SECT+RSRC_ENTRY

.data

Dlgbox  LABEL byte
INCBIN  "Dlgbox.res",RSRC_OFFSET

Menu    LABEL byte
INCBIN  "Menu.res",RSRC_OFFSET

[attachment deleted by admin]


xandaz

    Hi there. How the hell does one use the resources. I made this dialiog and an .rc files came out. The dialog has identifier 1000 but when i call DialogBoxParam nothing appears. Shouldn't i hace also a .res file? The files just need to have rsrc name and get into the executable when its built right? Thanks

Vortex

Hi xandaz,

Did you compile your .rc file? The resource compiler rc.exe outputs a .res file :

\masm32\bin\rc.exe rsrc.rc

ramguru

Quote from: Tedd on January 30, 2009, 10:50:22 PM
You could try linking the resources into a DLL, and then each program uses that DLL.

It could be tricky unless you know how to load 32bit dll from 64bit application :}
Otherwise you'll have to use 32bit and 64bit dll respectively

Quote from: Vortex on January 31, 2009, 05:22:17 PM
You can do that with assemblers supporting the INCBIN statement reading data from files.
INCBIN stores binary data in application, so that wouldn't be sharing (the only advantage - direct pointer to the data)  :naughty: , in regard to size it's the same as using resources as you would normaly in .rsrc section of each 32/64 app

jj2007

Quote from: ramguru on December 04, 2010, 05:57:35 PM
You could try linking the resources into a DLL, and then each program uses that DLL.

There is no CallProc64D, apparently ;-)

xandaz

    Thanks Vortex. I got it. It was just something i had never done. thanks and bye