Can it be done? if so how can you compile a resource script into a dll, and how would you use it from the exe? any help would be apreciated.

-Rage9
Posted on 2001-07-31 09:41:37 by Rage9
Yes. You do it like any win32 exe file: a DLL has
the PE format and the linker will create a .rsrc
section with the resources that you declared in
the .RC script.

Then if you want a resource, you need to find it
first calling to FindResource, passing the module
handle of the DLL where is the resource that you
need. You get this handle calling to LoadLibrary,
passing the address of the string with the name
of your DLL:

push offset my_dll_name
call LoadLibrary
push eax ; save the module handle
push RT_ICON ; If is a icon!
push offset my_icon_name ; or my_icon id
push eax ; value returned by LoadLibrary
call FindResource
pop ecx ; get the module handle
push eax ; handle to the specified resource's info block
push ecx
call LoadResource
push eax ; handle to the global memory block with the resource
call LockResource
mov pMyIcon, eax ; pointer to the first byte of the resource

pMyIcon is a pointer to your resource, here your icon.
Posted on 2001-07-31 23:39:15 by n u M I T_o r
Thank you very much, i eventualy did figure out how to compile it into the dll but not how to use it, thanks for clearing it up for me!

-Rage9
Posted on 2001-08-01 09:42:35 by Rage9
If you want to resource only DLL link it with the
/NOENTRY
Posted on 2001-08-03 01:49:10 by The Svin