作成方法1 |
CCreateContext context; memset(&context, 0, sizeof(CCreateContext)); g_pDocTemp = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CxxDocument), RUNTIME_CLASS(CxxFrame), RUNTIME_CLASS(CxxView)); context.m_pNewDocTemplate = g_pDocTemp; CWnd *pParent = CWnd::FromHandle(hParentWnd); CDocument *pDoc = g_pDocTemp->CreateNewDocument(); if(!pDoc->OnNewDocument()){ return NULL; } CxxFrame *pFrame = (CxxFrame*)g_pDocTemp->CreateNewFrame(pDoc, NULL); |
作成方法2 |
CCreateContext context; memset(&context, 0, sizeof(CCreateContext)); context.m_pNewViewClass = RUNTIME_CLASS(CxxxView); g_pViewClass = context.m_pNewViewClass; pFrame = static_cast< CxxFrameWnd* >( RUNTIME_CLASS(CxxxFrameWnd)->CreateObject() ); BOOL bCreate = pFrame->Create( NULL, //Windows クラス名 NULL, //ウィンドウ名 0, //ウィンドウスタイル CFrameWnd::rectDefault, //ウィンドウの位置とサイズ NULL, //親ウィンドウ NULL, //メニュー リソース 0, //拡張スタイル &context); //CCreateContext 構造体のポインタ |