Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to call instance in main.cpp
Re: How to call instance in main.cpp [message #5144 is a reply to message #5143] Thu, 07 September 2006 15:23 Go to previous message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
OK,here is the code structure:
Three files: main.cpp,LeftCtrl.h,RightCtrl.h
======================================================
main.cpp
#include "LeftCtrl.h"
struct App : public TopWindow
{.....
ULeftCtrl Left;
URightCtrl Right;
.....};

App::App()
{
h.Horz(Left,Right); Left.right=&Right;
.....}
======================================================
LeftCtrl.h
#include "RightCtrl.h"
class ULeftCtrl : public WithULeftCtrl<TopWindow> {
.....;URightCtrl * right;};
======================================================
RightCtrl.h
#include "CppSQLite/CppSQLite3.h" //<==move here now
class URightCtrl : public WithURightCtrl<TopWindow> {
....
CppSQLite3DB database;
String exeDML(const char* szSQL);
....;};
======================================================

in App call Ringht.database,Right.excDML
in LeftCtrl call right->database,right->exeDML
maybe & is more better.
Smile

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: always-on-top window
Next Topic: StaticRect blocks mouse events - deliberate?
Goto Forum:
  


Current Time: Thu Jun 12 18:21:57 CEST 2025

Total time taken to generate the page: 0.04111 seconds