Hi first of all I wanna thank gliptic for helping with my first question!

Well, I'm trying to program my app in a modular way like each dialog will have it's own asm file but I want all the includes, and variables in its own file. is this posible to do or is there a more efficient way of doing this sorta thing.

And what about global variables how do I define them, are they good, bad, or what ever?

Oh yeah, should I make all my dialogs use a seperate class or would it be better the use one class for all dialogs?

thanks ahead!!
Posted on 2001-10-07 00:17:41 by JamesE
There will be a lot of different opinions on this :). Gobal variables can
be necessary and good, as long as you THINK every time you are
about to use one. "Will this cause sorta dirty code?", "can this be
done cleaner (without dropping efficiency!)", et cetera. Global variables
could be put in a .asm file of their own, and referenced via a .inc that
defines correct EXTERNs or EXTERNDEFs.

I tend to keep a file per dialog, and keep as much as possible local,
so I will not clutter up the namespace (fancy word for a simple thing),
and will have cleaner interface between the various dialogs.

Dialogs and classes... RegsterClass(Ex) and CreateWindow(Ex) are
used for normal windows, not dialogs... so dialogs all sorta use the
same class :P
Posted on 2001-10-07 01:23:48 by f0dder

You have a number of questions there, GLOBAL data has its use and some things like the Instance handle are supplied by the operating system which is the start addres of an EXE file in memory. I tend to make handles global to avoid scope problems but there are other ways to do it if you are interested.

The idea of "modularity" will depend on what you have in mind, if you mean OOP style programming then have a look at what some of the members here are posting, Ernie Murphy's COM work or Nan and Thomas's OOP design work.

At lower level you have modules and libraries that can fully encapsulate data, the INCLUDE directive in MASM to include a file at any point you like in another file and of course the PROC model that is the fundamental basis of modular coding.

Just be careful not to get trapped in modern OOP folklore, globals are BAD, you are too dumb to write a switch/select case/.IF block, GOTO should be banned etc ....

This is the type of stuff for dummies slopping junk on a form in VB or Delphi, if you are interested in writing assembler, you cannot be restricted by this nonsense.

Just let us know what you are after and I am sure some of the members can help you.


Posted on 2001-10-07 03:06:25 by hutch--