CView::str = m_pstr
这种方法只能当CView中的str是静态成员变量才可以用
可以先得到CXXXView的指针再赋值
不过你为什么不把你的类做为View的成员变量呢

解决方案 »

  1.   

    CView::str又不是静态变量。
    赋值可以先得到CView的指针,再将值传递过去,显示用TextOut(...).
      

  2.   

    CString类的变量能直接赋值吗?
      

  3.   

    看看它的操作符吧?可以有这么多种类型呢
    CString::operator =
    const CString& operator =( const CString& stringSrc );
    throw( CMemoryException );const CString& operator =( TCHAR ch );
    throw( CMemoryException );const CString& operator =( const unsigned char* psz );
    throw( CMemoryException );const CString& operator =( LPCWSTR lpsz );
    throw( CMemoryException );const CString& operator =( LPCSTR lpsz );
    throw( CMemoryException );
      

  4.   

    CString类的变量能直接赋值吗?
    Of course can:
    CString str="MyStr";You can create a member:
      CView::SetYourStr(CString str)
    {
        strYourStr=str;
    }
    and in your class use SetYourStr().I think you made wrong in accessing CView,but not CString itself.