Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call dialog member function from another Dialog

Status
Not open for further replies.

kvant13

Programmer
Jul 9, 2003
12
GE
I have to use two Dialogs(CDialog). D1(parent) and D2(child).

I use (CWnd* pParent, it points D1) in D2 dialog constructor. And it works. But How can I call member Function from D1 in D2?????

Thanks
 
If you cast the parent to the appropriate type it will work if it is public:

Example

D2::D2(CWnd* pParent):
m_pParent(pParent)
{
((D1*)pParent)->MemberFunction(params);
}

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top