|
|
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to call instance in main.cpp
How to call instance in main.cpp [message #5127] |
Wed, 06 September 2006 16:32  |
Ulti
Messages: 108 Registered: September 2006
|
Experienced Member |
|
|
I have sereral files.LeftCtrl.h,RightCtrl.h,main.cpp,and I create a
database instance in structure App(in main.cpp),quetion is in LeftCtrl.h how to call this database instance?in MFC,there is a routine:AfxGetApp() to get the point of App,in U++,how to do this ?
|
|
|
|
Re: How to call instance in main.cpp [message #5129 is a reply to message #5128] |
Wed, 06 September 2006 17:17   |
Ulti
Messages: 108 Registered: September 2006
|
Experienced Member |
|
|
well,that's hard to describe,let's see some code:
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()
==================================================
static Vector<Ctrl *> Ctrl::GetTopCtrls();
static Vector<Ctrl *> Ctrl::GetTopWindows();
is that get App struct?
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.
[Updated on: Wed, 06 September 2006 17:27] Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:24:30 CEST 2025
Total time taken to generate the page: 0.00873 seconds
|
|
|