1. Document / View / Frame
CDocument *doc;
CSingleDocTemplate* DocTemplate;
DocTemplate = new CSingleDocTemplate(
IDR_MENU1,
RUNTIME_CLASS(MyDocument),
RUNTIME_CLASS(MyFrame),
RUNTIME_CLASS(MyView));
AddDocTemplate(DocTemplate);
doc = DocTemplate->CreateNewDocument();
m_pMainWnd = DocTemplate->CreateNewFrame(doc, NULL);
DocTemplate->InitialUpdateFrame(
(CFrameWnd*)m_pMainWnd, doc);
2. 動態宣告開啟
class MyFrame : public CFrameWnd
{
public :
DECLARE_DYNCREATE(MyFrame);
}
IMPLEMENT_DYNCREATE(MyFrame, CFrameWnd);
3. 更改視窗名稱
doc->SetTitle("Hello Document");
沒有留言:
張貼留言