在SDI中,VIEW窗体中有BOOL b;
在另一个窗体中如何取得b的值?请写具体些,谢谢!

解决方案 »

  1.   

    ((CxxxView*)GetActiveView ())->b
      

  2.   

    不管在什么地方先:
    CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd();
    然后再:
    BOOL Tempb = ((CxxxView*)GetActiveView ())->b
      

  3.   

    出错:undeclared identifier
    ((CTestView*)GetActiveView ())->b;
      

  4.   

    #include "TestView.h"之后:
    "b":is not a member of 'CTestView'
      

  5.   

    如果可以的话,可以将程序源代码发到:[email protected]
    我帮你看看!注明帖子的URL!
      

  6.   

    #include "TestDoc.h"
    #include "TestView.h"出错:"b":is not a member of 'CTestView'
      

  7.   

    你的BOOL变量不是属于View类的成员变量,而是一个全局变量,只要在MainFrm.cpp最上面添加:
    extern BOOL bTest;
    就可以直接访问了!