News:

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

Main Menu

Can't load a bitmap resource?!?!?

Started by NoCforMe, May 12, 2024, 07:49:21 AM

Previous topic - Next topic

sinsi

Quote from: sudoku on May 12, 2024, 12:37:46 PM@sinsi:

1 24 "manifest.xml"Yes, 24 is the type.  :biggrin:
1 is the ID.
That's my point, 504 could be "RT_SILLYPUTTY" and the resource compiler will just put it down as 504.


zedd151

:joking:

Just to add text to the post, I will add...

You might just be right.
:azn:

NoCforMe

Quote from: sinsi on May 12, 2024, 12:31:54 PMrc.exe just assumed that you knew what you were doing :biggrin: and used bitmap as the ID and 504 as the Type (see the "manifest" example, it uses 24 as the Type)
Hmm, that makes me think: I wonder if it would've worked if I had done this instead:
INVOKE    LoadImage, InstanceHandle, BITMAP, <file ID>, 0, 0, LR_SHARED
Switching the resource type and the resource ID? (probly have to define BITMAP in the source, as I don't think that's a windows.inc equate)
Because you can load other resources with LoadImage(), maybe not restricted to the known universe of typical types (IMAGE_BITMAP, etc.).
Not about to attempt this just yet. Wait until I get really bored ...
Assembly language programming should be fun. That's why I do it.

sinsi

Quote from: NoCforMe on May 12, 2024, 12:53:59 PM
Quote from: sinsi on May 12, 2024, 12:31:54 PMrc.exe just assumed that you knew what you were doing :biggrin: and used bitmap as the ID and 504 as the Type (see the "manifest" example, it uses 24 as the Type)
Hmm, that makes me think: I wonder if it would've worked if I had done this instead:
INVOKE    LoadImage, InstanceHandle, BITMAP, <file ID>, 0, 0, LR_SHARED

Switching the resource type and the resource ID? (probly have to define BITMAP in the source, as I don't think that's a windows.inc equate)
Because you can load other resources with LoadImage(), maybe not restricted to the known universe of typical types (IMAGE_BITMAP, etc.).
Not about to attempt this just yet. Wait until I get really bored ...
Not sure about LoadImage, but LoadResource with a type of 504 and an ID "BITMAP" as a string should work.

NoCforMe

Quote from: sinsi on May 12, 2024, 01:12:07 PMNot sure about LoadImage, but LoadResource with a type of 504 and an ID "BITMAP" as a string should work.
That's what I was thinking. Think about it: neither of those functions really knows anything about the actual thing (resource) that they're loading, just where it is and how big it is in the executable image.
Assembly language programming should be fun. That's why I do it.

NoCforMe

Oh, and just one more thing:
You can definitely use the LR_SHARED flag on "nonstandard" bitmaps (like my meter, which is 313 x 325 pixels).
Assembly language programming should be fun. That's why I do it.