From: David Wilkinson on
tomasu(a)gmail.com wrote:

> Hi David,
>
> I moved my CPropertyPage declarations from the top of my main dialog to
> within the functions where they were used and the assertion failure
> went away.
>
> I'm still not sure what was happening, but I am going to take your
> obviously great advice and do away with any and all global variables
> that are still lingering in my application. I'll also do some more
> digging and try and report here what was going wrong. I find it
> strange that I wasn't having any assertions until just last week...

Tomasu:

The point is that global objects are constructed at a very early stage
in the startup process, and if MFC is not initialized at this point (as
would seem to be the case) then you will get assertions if you try to
instantiate MFC objects.

I'm sure there are people here who could explain more about how C/C++
programs (and in particular Windows programs) initialize themselves.

David Wilkinson