|
From: Terry L F. <tf...@sm...> - 2003-03-19 14:19:48
|
Hello Louis,
Wednesday, March 19, 2003 you wrote:
LG> Are .res files optional or must they always be present in WIN32
LG> API apps ?
Resource files are not necessary.
LG> What is the advantage of having a menus etc. in the .res file and
LG> not in the .exe file?
Resource files are embedded directly into an executable or dll and
then at runtime the program uses the resource data. So if data in
the resource file changes the program still has to be recompiled
to create the executable.
Typically you begin with a .rc file (Resource Compiler file) which
can be edited. The .rc file is then compiled into a .res file.
Some programming languages even have converters for .res files so
that you might use it in different application languages.
Microsoft has a dialog editor (DLGEDIT.EXE) that produces a .dlg
file which can be edited with any text editor and saved as a .rc
file. DLGEDIT.exe produces 16 bit binary .res files so normally
not usable in 32 bit applications. You can make a few changes to
the .dlg file, save it as .rc and then use dev-c++ to edit it.
You mainly just change the block in the .dlg:
DLGINCLUDE RCDATA FIXED IMPURE
BEGIN
"FILE.H\0"
END
to
#include "FILE.H"
But now if you want to change the ICON or menu strings, other
strings, or even other user-defined items you can do it in the .rc
file - recompile it to a .res file - and then recompile your
application. But you haven't had to touch your code.
Terry Fritts
|