How do get a child dialogs handle?
-
I would like to use the CMyTabCtrl class for Tabs. I put a tab control on my dialog and implemented the code. The problem is that the buttons I have put on the tab have local message maps. I would like for them to call functions on my main dialog. I can not get the handle so that I can call class functions there. Help?:confused: :confused:
-
I would like to use the CMyTabCtrl class for Tabs. I put a tab control on my dialog and implemented the code. The problem is that the buttons I have put on the tab have local message maps. I would like for them to call functions on my main dialog. I can not get the handle so that I can call class functions there. Help?:confused: :confused:
Sample function:
CMyTabCtrl::MyFunction()
{
CMyDialog *pDlg = (CMyDialog*)GetParent();pDlg->TheOtherFunction(); ...
}
Do that only if the dialog is the parent window and it is of class CMyDialog. Cheers, Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)
-
Sample function:
CMyTabCtrl::MyFunction()
{
CMyDialog *pDlg = (CMyDialog*)GetParent();pDlg->TheOtherFunction(); ...
}
Do that only if the dialog is the parent window and it is of class CMyDialog. Cheers, Paolo ------ "airplane is cool, but space shuttle is even better" (J. Kaczorowski)
Duh! This is what I get for not doing any windows programming for about a year. will not let that happen again. I think my problem was that I was casting as a CDialog instead of the derived class that includes all of my functions. Thanks Paolo. Sometimes to catch mice, you have to act like cheese...:laugh: