Can somebody please tell me why bother create a dialog (and text boxes, and other stuff) in 'WinMain' when you can use resource files to do the same thing, or do they do different things?
What you can get inside Resources, with a resources Editor,
you can always get it by hand, coding in your application.
1) Usualy, coding by hands takes much more room than Resources
and more time for you.
2) Coding by hand is more flexible than a any resources Editor.
Hand made templates are more easy to modify at run-time than
Resource templates.
As Editing a resource is much more easy than writing by hand,
(particulary for Pos, what is always killing long, by hand),
you should use Resources to cover all usual needs.
As Code building is much more powerfull and flexible, you should
choose it in case of particular problems to solve, or in case you
want run-time modifications. Example, you can modify the number
of Controls in a Dialog with one single code instruction modifying
the third record of a Dialog Template in Memory (whereas it is
much more difficult with a Template in Resources).
Example: Writing a Configuration Tabbed Dialog (let's say with
10 Child Dialogs on it) is a killing task with infinite tests for
Pos, resulting in 10 or 20 code screens. Editing it with a Resources
Editor is one afternon work and 2 or 4 codes code screens.
Right, thanks for that guys. It helped a lot. So when I *do* use a resource editor, which is the best one to use. I have lcc-win32 but can't seem to work it properly. I get this feeling i'm doing something wrong...
Do you have Microsoft's old AppStudio lying around?
It's quite okay; being 16-bit makes no difference,
since it outputs just resource scripts *.rc.
I think a PE executable should just about always
have a resource _table_, rather than structures
like MENUITEMINFO or whatever in the asm source.
Loading speed won't matter much, particularly for
graphical resources. String tables may be more
compact and more manageable in asm source, though.
A resource _table_ need not be in its own
_resource section_. The masm linker always makes
such a section, called .rsrc. But the res table
may go in any readable section, including a code
section. This would make it a little harder to
disassemble. There are tricks for putting any
data (such as an icon or a whole resource table)
anywhere in an asm source file. Ask if interested.
OT, it would be nice to have some decent
documentation on resource scripts *.rc.
>OT, it would be nice to have some decent
>documentation on resource scripts *.rc.
// DIALOG and DIALOGEX resources
//
// Format:
// nameID DIALOG x, y, width, height
// or
// nameID DIALOGEX x, y, width, height [,helpID]
// nameID is the reference of the program to identify this dialog. Don't change it !
// x,y,width and height define the dimension of the dialog box in dialog units.
//
// Following are optional descriptions for the entire dialog:
//
// CAPTION ""
// defines the caption in the dialog's title bar, if present
//
// STYLE