先要找到这个View的指针pView
比如是SDI的程序,可以很简单地写出:
void CMainFrame::ExampleFunc()
{
   CMyView *pView=(CMyView*)GetDescendantWindow(AFX_IDW_PANE_FIRST);
   ASSERT_KINDOF(pView,CMyView);
   pView->GetDC()->TextOut(10,10,"hello,world");
}

解决方案 »

  1.   

    CMyView* pView = (CMyView*) GetActiveView();
    pView ->GetEditCtrl().SetWindowText( "sometext" );
      

  2.   

    如果是分隔视的话,是:    CMyView *pView = (CMyView*)m_SplitterWnd.GetPane(0,0);
        pView->SetWindowText("Your text goes here");
      

  3.   

    先认为你是sdi,那么只需geteditctrl一下取得edit的指针,然后就可以向操纵edit那样操纵ew了。假如是mdi,则先要调用getactiveviw取得当前view的指针,然后就像sdi一样就可以了。
      

  4.   

    感谢各位的热心帮助我用的是111222(革命吧)的方法,我在MainFrame.h中加入class CWCCSView;
    在MainFrame.cpp中使用如下代码:
    CWCCSView *pView=(CWCCSView *)GetActiveView();
    pView->GetEditCtrl().SetWindowText("asdfasdfdsafa"); 其中CWCCSView *pView=(CWCCSView *)GetActiveView();可以编译通过
    但pView->GetEditCtrl().SetWindowText("asdfasdfdsafa"); 会出现以下错误:error C2027: use of undefined type 'CWCCSView' see declaration of 'CWCCSView'
    error C2227: left of '->GetEditCtrl' must point to class/struct/union
    error C2228: left of '.SetWindowTextA' must have class/struct/union type望指教