标签:
//头文件“CMyApp.h”
#include <afxwin.h>
class CMyApp : public CWinApp{
public:
virtual BOOL InitInstance();
};
//继承CWinApp类,重写初始化实例函数。
class CMyFrame :public CFrameWnd{
public:
CMyFrame();
};
//继承CFrameWnd类,构造函数。
//源文件“CMyApp.cpp”
#include "CMyApp.h"
CMyApp app;//全局实例对象
BOOL CMyApp::InitInstance()
{
// TODO: 在此添加专用代码和/或调用基类
this->m_pMainWnd = new CMyFrame();//创建窗口
this->m_pMainWnd->ShowWindow(this->m_nCmdShow);//显示窗口
this->m_pMainWnd->UpdateWindow();
return CWinApp::InitInstance();
}
CMyFrame::CMyFrame(){
this->Create(NULL, TEXT("WND-NAME"));
}

标签:
原文地址:http://www.cnblogs.com/dons/p/4888453.html