VC中创建一个多文档界面(MDI),怎么把它的子文档改成对话框的形式?
(本人VC初学,希望能详细一点描述。)

解决方案 »

  1.   

    对,在APPWIZARD的最后一步选择视图类基于CFormView就可以了
      

  2.   

    用CFormView或在你的多文档视图上create一个对话框。
      

  3.   

    子文档跟你的文档模板有些关系
    你可以试着加入新的模板,就能使用各种view了
    formview也一样可以加进去
      

  4.   

    方法1:在创建时的最后一项一项选择基类时选择为CFromView类
    方法2:在CView::OnCreate()中创建。
      

  5.   

    在CMyApp::InitInstance()中:CMultiDocTemplate* pDocTemplate;
    pDocTemplate = new CMultiDocTemplate(
    IDR_SGYREATYPE,
    RUNTIME_CLASS(CSgyReaderDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(CSgyReaderView));
    AddDocTemplate(pDocTemplate);

    pDocTemplate1 = NULL;
    pDocTemplate1 = new CSingleDocTemplate(
    IDR_SGYREATYPE1,
    RUNTIME_CLASS(CSgyReaderDoc),
    RUNTIME_CLASS(CMainFrame1),
    RUNTIME_CLASS(CSectionView)); if(pDocTemplate1 == NULL)
    return FALSE;

    pDocTemplate2 = NULL;
    pDocTemplate2 = new CSingleDocTemplate(
    IDR_SGYREATYPE2,
    RUNTIME_CLASS(CSgyReaderDoc),
    RUNTIME_CLASS(CMainFrame2),
    RUNTIME_CLASS(CTimeSliceView));
    if(pDocTemplate2 == NULL)
    return FALSE;

    pDocTemplate3 = NULL;
    pDocTemplate3 = new CMultiDocTemplate(
    IDR_SGYREATYPE,
    RUNTIME_CLASS(CSgyReaderDoc),
    RUNTIME_CLASS(CChildFrame), // custom MDI child frame
    RUNTIME_CLASS(C3DView));这是我的程序,用了4个文档模板。