不管选哪个,结果是一样的

解决方案 »

  1.   

    我先是默认建立了SDI工程然后添加了一个FormView然后再添加一个splitterbar然后问题就来了
      

  2.   

    代码没什么的,我按F10,第二句就会出现这个窗口:extern "C" int WINAPI
    _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPTSTR lpCmdLine, int nCmdShow)
    {
    // call shared/exported WinMain
    return AfxWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
    }上面这段代码也不知道是哪来的
      

  3.   

    是的,同意楼上我刚做过SDI的程序,也是两个视图类。如果是一个文档模板,应该不会出现这个问题
      

  4.   

    检查你的WINAPP---INSISTANCE里看看是不是两个文档模板
      

  5.   

    CSingleDocTemplate* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CEx01bDoc),
    RUNTIME_CLASS(CMainFrame),       // main SDI frame window
    RUNTIME_CLASS(CEx01bView));
    AddDocTemplate(pDocTemplate);这样的东西只有一个才对。
    视图是在下面的代码里加的:
    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    m_wnd.CreateStatic(this,2,1);
    m_wnd.CreateView(0,0,RUNTIME_CLASS(CEx01bView),CSize(250,250),pContext);
    m_wnd.CreateView(1,0,RUNTIME_CLASS(CMyView1),CSize(250,250),pContext); //return m_wnd.Create(this,2,2,CSize(20,20),pContext); return true;

    //return CFrameWnd::OnCreateClient(lpcs, pContext);
    }
      

  6.   

    CSingleDocTemplate* pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(
    IDR_MAINFRAME,
    RUNTIME_CLASS(CFormDoc),
    RUNTIME_CLASS(CMainFrame),         // main SDI frame window
    RUNTIME_CLASS(CMyFormView));
    AddDocTemplate(pDocTemplate); // Parse command line for standard shell commands, DDE, file open
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
    return FALSE; // The one and only window has been initialized, so show and update it.
    m_pMainWnd->ShowWindow(SW_SHOW);
    m_pMainWnd->UpdateWindow(); return TRUE;没有两个模板吧