Can anyone see why this doesnt execute???
Its straight out of the VC++ 6 standard edition book and it just crashes. OS=XPSP1 VC6 +SP6 any ideas would be nice.
Code:
#include <afxwin.h>
//Class definition
class COurWnd : public CFrameWnd
{
};
//application class definition
class COurApp : public CWinApp
{
public:
virtual BOOL InitInstance();
private:
COurWnd* GetMainWindow() { return static_cast<COurWnd*>(m_pMainWnd); }
};
//Function to create instance of main window
BOOL COurApp::InitInstance(void)
{
//construct an object of our class
m_pMainWnd = new COurWnd;
//call create() to do the window
GetMainWindow()->Create(NULL, _T("Backplane"));
//Display it
GetMainWindow()->ShowWindow(m_nCmdShow);
return TRUE;
}
// Application object in global scope
COurWnd AnApplication;