I have a derived class CMyButton : CButton
I want to create a pointer from CMyButton to CMyDialogDlg so that I can write to member variable m_EditBox, which is a control of CMyDialogDlg
Here's what I've tried:
In MyButton.h declaring
Then in the initialization of CMyButton
pDlg = GetParent();
pDlg = FindWindow("CMyDialogDlg", "WindowName")
pDlg = GetOwner();
They all return a pointer to CWnd not CMyDialogDlg, so I get an error.
The only way it works is if I declare
Then the statement
pDlg->m_EditBox doesn't work cuz it's not a member of CWnd.