Problem with constructors being called before GXInit

There is a problem if the CGXGridParam constructor is called and the GXInit method has not been called. This can happen if you embedded a grid window into a dialog-only app. The dialog class is constructed before the InitInstance method is called.

We added the following ASSERT in the CGXGridParam, CGXGridCore and CGXProperties constructor together with a suggestion how to work around the problem.

CGXGridCore::CGXGridCore(CWnd* pGridWnd, CDocument* pGridDoc, BOOL bIsViewContext)
{
   m_pAppData = GXGetAppData();
   ASSERT(m_pAppData->m_bInitDone);
   // ASSERTION-> This constructor is called before the GXInit()
   // method has been called. This can be problematic because
   // at this time no factory object is available.
   //
   // Make sure you didn't simply forget to call GXInit() from
   // your application's InitInstance method. 
   //
   // Another reason for this problem can be that the object is 
   // constructed at the same time that your application object 
   // is instantiated, for example if you embedded this class 
   // as member variable in the application class. 
   // 
   // To resolve the problem we recommend you instantiate the
   // object on the heap. Change your class declaration and
   // declare a pointer to this class. After GXInit() has been
   // called you can call m_pGrid = new CGXGridCore. In your
   // class destructor don't forget to delete m_pGrid.
   // ->END