Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Global variable
Message
From
27/01/2002 03:30:35
 
 
To
26/01/2002 07:06:35
General information
Forum:
Visual C++
Category:
Classes
Title:
Miscellaneous
Thread ID:
00610543
Message ID:
00611210
Views:
27
Greg,

If you are using MFC and the document/view architecture then you can add a member variable to the document class. This can then be accessed by your views using code like this:
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.

HTH
Neil
Previous
Reply
Map
View

Click here to load this message in the networking platform