zsolt Messages: 702 Registered: December 2005 Location: Budapest, Hungary
Contributor
koldo wrote on Mon, 22 March 2010 15:55
Hello all
I would like to ask you how you design professional U++ applications.
Thinking in a GUI application with a main window, how do you connect classes with main class containing main Serialize/Xmlize configuration:
- Main class is a global variable.
- You include in classes constructor as argument a pointer to main class
- You access from a subclass the main class using dynamic_cast<MainClass *>(GetParent()->GetParent()-> ... as many times as necessary.
And in your main window's Serialize method will be like this:
void MainWindow::Serialize(Stream& s)
{
int version = 1;
s / version;
SerializePlacement(s);
some_member.Serialize(s);
SerializeGlobalConfigs(s);
if(version<2) return;
//this is used in newer versions
}