News:

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

Obsolete Resource Attributes

Started by MichaelW, October 20, 2006, 09:11:38 PM

Previous topic - Next topic

MichaelW

I keep seeing "MOVEABLE PURE LOADONCALL DISCARDABLE", and similar, in resource definitions. I stopped using these attributes after reading somewhere, perhaps here, that they are a holdover from 16-bit Windows. But I also seem to recall reading that one of them, DISCARDABLE, still performed some useful function. Searching for information on this, I found mostly what appeared to be old code, on pages that were typically not dated, and which neglected to specify which version of Windows the information applied to. I did, however, find this:

MSDN: RESOURCEHEADER Structure

Which flatly states that all of these attributes are ignored starting with NT 3.1 and Windows 95.

To test this I selected two MASM32 examples, example05\riched and example06\treedemo, and built the EXEs with and without any instances of MOVEABLE, PURE, LOADONCALL, or DISCARDABLE in rsrc.rc. In both cases the only differences in the EXEs, as determined by FC /b, were in the Time Date Stamp.
eschew obfuscation

P1

I have always seen these in the resource files.  Seeing that I have not the time to be messing with something that works. 

It seems that "DISCARDABLE" is still actively used in C source that I translate.

So from a simple point of observation, I would say that you could save yourself 25 characters in your .rc file to leave out everything but "DISCARDABLE".

Regards,  P1  :8)


Tedd

Quote
PRELOAD       - Ignored
LOADONCALL - Ignored
FIXED            - Ignored
MOVEABLE     - Ignored
PURE             - Ignored
IMPURE          - Ignored
DISCARDABLE - Resource can be discarded if no longer needed.

The default is DISCARDABLE for cursor, icon, and font resources.

Either way, you don't need to specify any of them - the resource compiler will add appropriate defaults.
No snowflake in an avalanche feels responsible.