你自己在CMDIApp的中添加就可以了。
in .hclass CMDIApp : public CWinApp
{
......
// Member variables used to store the various
// document templates objects that we create in
// InitInstance()
CMultiDocTemplate* m_ptDrawing;
CMultiDocTemplate* m_ptCounter;
........
}in .cppBOOL CMDIApp::InitInstance()
{
.....
// Register the application's document templates. . // 'Drawing' document template
m_ptDrawing = new CMultiDocTemplate(
IDR_DRAWTYPE,
RUNTIME_CLASS(CDrawDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CDrawView));
AddDocTemplate(m_ptDrawing); // 'Counter' document template
m_ptCounter = new CMultiDocTemplate(
IDR_COUNTTYPE,
RUNTIME_CLASS(CCountDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CCountView));
AddDocTemplate(m_ptCounter);
//在上面的文档魔板的生成的过程中,可以随便使用自己喜欢的视图类、
//框架类和文档类,但是需要特别说明的是,你必须自己添加相应的各种资源
//可以使用copy 和paste的方法
//在以后可以使用上面的文档魔板指针操纵相关的对象!
.......
}

解决方案 »

  1.   

    这个我知道,那么如何创建使用指定摸板的窗体呢?我看MSDN的例子根本没看到有指定摸板的代码。恳请再次指教
      

  2.   

    深入浅出MFC上有说明。具体我说不清了。
      

  3.   

    pTemplate = theApp.GetTemplateByViewType(viewType);
    posDoc = pTemplate->GetFirstDocPosition();
    pDoc = (CPCSimDoc *)pTemplate->GetNextDoc(posDoc);
    if (pDoc == NULL) {
    pDoc = (CPCSimDoc *)pTemplate->CreateNewDocument();
    }
    /* create a new frame */
    CMDIChildWnd* pNewFrame
    = (CMDIChildWnd*)(pTemplate->CreateNewFrame(pDoc, NULL));
    pTemplate->InitialUpdateFrame(pNewFrame, pDoc);