Re: Resources
From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 02/05/04
- Next message: Igor Tandetnik: "Re: Microsoft Speech Server"
- Previous message: Bonj: "Re: Resources"
- In reply to: Bonj: "Re: Resources"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 5 Feb 2004 18:34:56 -0500
"Bonj" <a@b.com> wrote in message
news:uZ23J3D7DHA.3704@tk2msftngp13.phx.gbl...
> Picking
> > the icon with the lowest ID to show for an executable is the
standard
> > behavior of Windows Shell and has nothing to do with what compiler
the
> > executable was built with.
>
> But how does windows know what compiler the program is built with
It does not know nor care.
> and how
> does it know that it even uses IDs for its icons?
Because it's part of the Portable Executable format that every Windows
executable must conform to. You are confusing cause and effect. Windows
operating system defines the format of a valid executable file, and
compiler builds a file that conforms to this format, not the other way
round. The way to store resources in an executable, and assign IDs to
them, is part of this format.
> I thought the chip that
> gets fed the code when you run an .exe only understands machine
language,
Resources are not code and are never executed. They are data, and are
simply read from the file. You aren't surprised that a text file does
not contain valid machine codes, right?
> and hence the only thing that Windows explorer can use to glean the
> information on what icon to display?
You thought wrong. There's more to PE format than just raw machine code.
Ever wondered where string literals go?
> > As you say, the IDs you assign in resource.h are preserved, so I
don't
> > see the problem here either.
>
> They are, but I didn't know that they were going to be! It was a
stroke of
> luck, I'm sure - so I thought it could be one of those features that
they'd
> built into .NET but wasn't compliant behaviour necessarily.
Compliant with what?
> If you put it in release mode and compile it without using all the
icons,
> does it omit the unused icons from the .exe, in the same way that it
does
> for functions?
No.
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
- Next message: Igor Tandetnik: "Re: Microsoft Speech Server"
- Previous message: Bonj: "Re: Resources"
- In reply to: Bonj: "Re: Resources"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|