CTestDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); pDoc->m_testflag = 1;If you are not using the document/view architecture then open up the source file that ends in App, for example a wizard generated project called TestMFC would have a CTestMFCApp source file. Before or after the line that reads
CTestmfcApp theApp;add your global variables like so.
CTestmfcApp theApp; int testflag;The testflag variable should now appear under the Globals node of ClassView tab.