in main.cpp:
struct App : public TopWindow
{
ULeftCtrl Left;
URightCtrl Right;
....
CppSQLite3DB database;//that is another
String exeDML(const char* szSQL);
//this routine to parse szSQL and record every INSERT or UPDATE with acture ROWID.
....
}
GUI_APP_MAIN
{
App().Run();
}
in LeftCtrl.h(represent Left Pane) somewhere
want to call database.xxx and exeDML()
if not this not help,I can define database pointer in LeftCtrl.h and then in App::App() make this pointer point to database,but I got no idea with exeDML.I have to consider trigger or some other way.
What about to simply make things global? In the end AfxGetApp is an global variable (accessed via function) too.