#include <afxwin.h>
#include "resource.h"
class CMainFrame : public CFrameWnd {
public:
DECLARE_DYNCREATE(CMainFrame);
};
class CMyDoc : public CDocument {
public:
DECLARE_DYNCREATE(CMyDoc);
virtual BOOL OnNewDocument() override {
return TRUE;
}
virtual void Serialize(CArchive& ar) override {
}
};
class CMyView : public CView {
public:
DECLARE_DYNCREATE(CMyView);
virtual void OnDraw(CDC* pDC) override {
}
};
IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd);
IMPLEMENT_DYNCREATE(CMyDoc, CDocument);
IMPLEMENT_DYNCREATE(CMyView, CView);
class CMYApp : public CWinApp {
public:
BOOL InitInstance() {
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(IDR_MAIN_FRAME,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CMyView)
);
if (pDocTemplate == nullptr) {
return FALSE;
}
AddDocTemplate(pDocTemplate);
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (!ProcessShellCommand(cmdInfo)) {
return FALSE;
}
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
int ExitInstance() {
return 0;
}
};
CMYApp theApp;