Problem around usage of RUNTIME_CLASS
-
Hello all... I'm lost... maybe because I'm searching to deep, but anyway. My collega came to me for help, but unfortunately.. :confused: Let's take a look to this sample:
class CMySystems{
// Anything
};class CMyDetails{
// Anything
};void xxx::SomeMethod( void )
{
...
// Sets up the (docking) TabControlBar
m_wndMyCtrlBar.AddView("Systems", RUNTIME_CLASS(CMySystems));
m_wndMyCtrlBar.AddView("Details", RUNTIME_CLASS(CMyDetails));
...
}Now the problem: In the class CMySystems I want to be able to use methods from the class CMyDetails. How can I at runtime pass the 'this' pointer of the CMyDetails class to the CMySystems? Thanks in advance, EiSl
-
Hello all... I'm lost... maybe because I'm searching to deep, but anyway. My collega came to me for help, but unfortunately.. :confused: Let's take a look to this sample:
class CMySystems{
// Anything
};class CMyDetails{
// Anything
};void xxx::SomeMethod( void )
{
...
// Sets up the (docking) TabControlBar
m_wndMyCtrlBar.AddView("Systems", RUNTIME_CLASS(CMySystems));
m_wndMyCtrlBar.AddView("Details", RUNTIME_CLASS(CMyDetails));
...
}Now the problem: In the class CMySystems I want to be able to use methods from the class CMyDetails. How can I at runtime pass the 'this' pointer of the CMyDetails class to the CMySystems? Thanks in advance, EiSl
It seems that TabControlBar creates CMySystems and CMyDetails objects for you - one of the CRuntimeClass responsibilities is creating CObject-derived objects. If your question is how to get actual object after it is created by CRuntimeClass, the answer is: you depend on TabControlBar. This class should give you access to its views; I'd expect something like TabControlBar::GetFirstView/GetNextView. Since it's 3rd party class, I can't help you futher. Tomasz Sowinski -- http://www.shooltz.com