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 SkipVought 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 CWnd * member function???

Status
Not open for further replies.

kvant13

Programmer
Jul 9, 2003
12
0
0
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
 
Make a member variable of type D1 if it needs to access specific functions of D1. It would be better if you made it a CWnd*, but if you really need to make it D1, that works. I'll call this member m_pD1.

In the constructor, put this:
m_pD1 = (D1*)pParent;

Then just call the other functions like this:
if(m_pD1 != NULL)
m_pD1->D1MemberFunc();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top