Re: Some more questions

GWRepNate@AOL.Com
Wed, 20 Nov 1996 21:08:04 -0500

In a message dated 96-11-20 19:07:10 EST, dg@dcs.st-and.ac.uk writes:
> 2. How are global and static variables stored? I presume that they're put
> in the relevant code resource. But, code resources should be discardable.
> If so, are the values of the variables lost? If not, are all code
> resources kept loaded all the time? And what happens if they are accessed
> from some other code resource? Does the compiler generate the appropriate
> code to load it? GOC doesn't appear to produce anything special. I'm
> writing a single-launchable application, so I don't need to worry about
> which instance of the variable is being accessed.

Global and static local variables are stored in a fixed block called
dgroup. This remains in memory for the duration of your application.

> 3. Is there any message that is received when the user interface tree is
> built and ready? My program has a window in which various status messages
> are displayed. When the program is run, it has to do some initialising,
> and I want to tell the user that this is happening. So that the user can
> see these messages, I have to wait until the window is ready before
> starting. If I don't, initialisation is complete by the time the window is
> drawn. Currently, the first time my window's MSG_META_REDRAW is called, it
> sends a message back to the process to tell it to start initialising. Not
> only is this very nasty, it only works on the EC version. The NC version
> doesn't display anything at all.

Try MSG_VIS_OPEN.

> 4. Is there any reason why I can't use the -P option to BCC to tell it to
> build in C++ mode? This will let me use some C++ constructs such as //
> comments and declaring variables as I need them. This would let me tidy my
> code somewhat.

Make a local.mk file like this:

CCOM_FLAGS += -P
#include <$(SYSMAKEFILE)>

If that doesn't work, then change the compiler.mk file in the Include
directory.

Nathan