Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » access to CExtResizableDialog main Collapse All
Subject Author Date
VALGOR Jul 27, 2009 - 9:07 PM

Dear support

I have a CExtResizableDialog that has a CExtTabPageContainerWnd formed by several CExtResizableDialog

My problem is how can I access this from a CExtResizableDialog in
CExtTabPageContainerWnd a main CExtResizableDialog?


CExtResizableDialog m_DialogMain;

CExtTabPageContainerWnd m_MyTab;

CExtResizableDialog m_DialogTab1;
CExtResizableDialog m_DialogTab2;
CExtResizableDialog m_DialogTab3;
CExtResizableDialog m_DialogTab4;

....
Create All;
....

from m_DialogMain I can access without problems to
m_MyTab and turn m_DialogTab1, m_DialogTab2, m_DialogTab3, m_DialogTab4
but from m_DialogTab1, m_DialogTab2, m_DialogTab3, m_DialogTab4
How you can access to m_DialogMain?

using GetParent() gives me exception error to execute.

Thank you for your kindness

best regards..

Valentin Spain

VALGOR Jul 28, 2009 - 6:36 PM

thank you very much

Technical Support Jul 28, 2009 - 8:44 AM

You should invoke the GetParent() API two times from any methods of the m_DialogTab*** dialog pages because the first parent is the CExtTabPageContainerWnd window and the second parent is the m_DialogMain window.

void CYourDialogPageClass::SomeMethod()
{
      //
      // 1st
      //
CWnd * pWnd = GetParent();
      ASSERT_VALID( pWnd );
      ASSERT( pWnd->GetSafeHwnd() != NULL );
      ASSERT( pWnd->IsKindOf( RUNTIME_CLASS( CExtTabPageContainerWnd ) ) );

      //
      // 2nd
      //
      pWnd = pWnd->GetParent();
      ASSERT_VALID( pWnd );
      ASSERT( pWnd->GetSafeHwnd() != NULL );
CYourMainDialogClass * pMainDialog = STATIC_DOWNCAST( CYourMainDialogClass, pWnd );
      . . .
}