#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派生出来的窗口想让其当主窗口,应该怎么做。
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派生出来的窗口想让其当主窗口,应该怎么做。
AfxGetApp()->m_pMainWnd=你想让谁当主窗口就是谁啦
懂的话,帮忙看一下上面的程序如何更改...
我的问题关键是解决 CWnd派生的
我重载了,Create,重载了ShowWindow不知道怎么的,仍然显示不出窗口.