#include <afxwin.h>
class CMyWnd: public CWnd
{
public:
afx_msg void OnPaint();
};
class CMyApp: public CWinApp
{
public:
BOOL InitInstance();
};
BOOL CMyApp::InitInstance()
{
CMyWnd *pMyWnd=new CMyWnd;
pMyWnd->Create(0,"MFC",WS_OVERLAPPEDWINDOW,CRect(100,200,300,300),NULL,11);
pMyWnd->ShowWindow(m_nCmdShow);
return true;
}
CMyApp theApp;pMyWnd->Create(0,"MFC",WS_OVERLAPPEDWINDOW,CRect(100,200,300,300),NULL,11);
跟踪知,倒数第二个参数在CWnd::Create不能为NULL
请问一下,从CWnd派生出来的窗口想让其当主窗口,应该怎么做。