Chapter 2 Variables and Identifiers Visual C++ and MFC Fundamentals
// Use a pointer to the window's frame for the application
// to use the window
CSimpleFrame *Tester = new CSimpleFrame ();
m_pMainWnd = Tester;
// Show the window
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
CSimpleApp theApp;
Figure 24: Windows Application.................................................................................................
- Test the program
- To close the window, click its system Close button and return to MSVC
- To provide a checking process with the CObject::AssertValid() method and to
diagnosis services using the CObject::Dump() method, change the file as follows:
#include <afx.h>
#include <afxwin.h>
class CSimpleFrame : public CFrameWnd
{
public:
CSimpleFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
};
struct CSimpleApp : public CWinApp