Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Global variable
Message
De
27/01/2002 03:30:35
 
 
À
26/01/2002 07:06:35
Information générale
Forum:
Visual C++
Catégorie:
Classes
Titre:
Divers
Thread ID:
00610543
Message ID:
00611210
Vues:
28
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform