The MASM Forum

General => The Campus => Topic started by: daydreamer on May 13, 2020, 05:13:40 AM

Title: is it possible to link in data file
Post by: daydreamer on May 13, 2020, 05:13:40 AM
Maybe Similar to static library,with some tiny proc that LEA to data to be used
Preferably bitmap data, to be read, not the kind of bitmap resource with handle to bitblt it,but pointer so can read data to map?
Maybe load as hex,save as binary options in QE can help?

Title: Re: is it possible to link in data file
Post by: Vortex on May 13, 2020, 05:43:32 AM
Hello,

You can check this example :

http://masm32.com/board/index.php?topic=4642.msg49923#msg49923
Title: Re: is it possible to link in data file
Post by: jj2007 on May 13, 2020, 11:49:32 AM
invoke FindResource, 0, ResID, RT_RCDATA ; get resource handle
xchg eax, ebx ; hRes
push rv(SizeofResource, 0, ebx) ; size in bytes
invoke LoadResource, 0, ebx ; returns pointer to content in eax


Demo (source & exe attached):
GuiParas equ "Embedded image", w500, h200, icon Lens
include \masm32\MasmBasic\Res\MbGui.asm
Event Paint
  GuiImage 123, fit
GuiEnd


This is the content of the rc file: 123 RCDATA "\\Masm32\\examples\\exampl04\\car\\car.jpg"
Title: Re: is it possible to link in data file
Post by: hutch-- on May 13, 2020, 03:43:27 PM
As long as it is in 32 bit, use the "fda.exe" or "fda32.exe" that comes with masm32 to make an object module.
Title: Re: is it possible to link in data file
Post by: daydreamer on May 13, 2020, 06:06:24 PM
thanks
Title: Re: is it possible to link in data file
Post by: TimoVJL on May 14, 2020, 01:12:19 AM
assembler with INCBIN is a good option.

PellesC users have an AddiIn for that, File2Obj