如题

解决方案 »

  1.   

    void CCarViewView::OnDraw(CDC* pDC)
    {
    CCarViewDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    pDC->TextOut(20,20,"fdsfds");
    // TODO: add draw code for native data here
    }BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (!m_wndSplitter.CreateStatic(this, 1, 2))
    return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) ||
    !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext))
    {
    m_wndSplitter.DestroyWindow();
    return FALSE;
    } return TRUE;}
      

  2.   

    刚才试了一个,可以显示的,我觉得原因可能是,因为有两个CView类(左右窗口各一),你的OnDraw()函数是在其中一个定义的,另一个没有定义。
      

  3.   

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (!m_wndSplitter.CreateStatic(this, 1, 2))
    return FALSE; if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(250, 100), pContext) ||
    !m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CCarViewView), CSize(100, 100), pContext))
    {
    m_wndSplitter.DestroyWindow();
    return FALSE;
    }
             m_wndSplitter.GetPane(0,0)->SetWindowText(TEXT("..."))//用这个代码显示文字
    return TRUE;
    }