News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

loading files included in the resource file (.RC)

Started by clip32, October 26, 2009, 09:23:05 AM

Previous topic - Next topic

clip32

Hi,

   Does anyone have a sample code that loads a file included from its resource file (.rc)? I know around 10 years ago, someone already posted a code for that, I just don't know if it's on this board or on the another board.


Regards,

Clip

Ficko

Do you mean loading a "executable" file from the resource?

I don't think it is possible directly but you can always read the resource write it to a file and execute it. :8)

clip32

ficko,

> Do you mean loading a "executable" file from the resource?

"any" file, e.g., JPEG, GIF, AVI


> I don't think it is possible directly but you can always read the resource write it to a file and execute it. Cool

yep, this is what i mean, can you please point me to where i can find this?


Thanks,

Clip

Ficko

"c:\masm32\examples\exampl06\mob\cws\cws.asm"

It loads a bitmap.

But if you want just random loading you have to use

1. FindResourceA
2. SizeofResource
3. LoadResource
If you have to copy it to a certain memory
4. LockResource
5. RtlMoveMemory
6. WriteFile

clip32

Quote from: Ficko on October 26, 2009, 10:04:30 AM
"c:\masm32\examples\exampl06\mob\cws\cws.asm"

It loads a bitmap.

But if you want just random loading you have to use

1. FindResourceA
2. SizeofResource
3. LoadResource
If you have to copy it to a certain memory
4. LockResource
5. RtlMoveMemory
6. WriteFile


ok this is drcmda's (is he still here?) custom window app. this is loading a BITMAP. I was kind of hoping for a code that can load (as in loadresource) ANY file type and save it on a directory. Sort of like packaging everything into one file rather than including them on a self extracting zip file.

anyway, I appreciate your help. now it's time to look for my dusty win32api help file.


Thanks,

Clip

clip32

alright, i found the solution, it's on thomas' site

so you don't have to "work" for it:
http://www.madwizard.org/programming/snippets?id=55

regards,

Clip