Global variable

Manuel Martín mmartin at ceyd.es
Wed Apr 11 11:41:56 PDT 2007


Hi

 >Is it possible to get access to 'something' from any part of code? I am
 >wondering how to define a pointers to data base and and SQL query and >to
 >  be able to use it from different part of the code, even from >different
 >source file.

Haven't you tried something like this?
//in file A.cpp
extern MyClassForThis* pointerToClass = (MyClassForThis*)NULL;
.
.
.
pointerToClass = new MyClassForThis(...


//in file B.cpp
extern MyClassForThis* pointerToClass;
.
.
.
do something with pointerToClass

HTH
Manolo




More information about the wx-users mailing list