Re: Exchanging the string data between two dailogs
Hi Thanks to all them, it was a good start for me to under stand most
of things,
Hi Goran,
i have followed your approch, like below but i have got some error at
SetDlgItemText(),
class CFirst : public CDialog
{
void SecondChanged(const CString& s)
{ SetDlgItemText(IDC_EDIT_FIRST, s); }
};
class CFirst;
class CSecond : public CDialog
{
CSecond(CFirst& first) : m_first(f), CDialog(IDD) {}
afx_msg void OnEnChangeEdit();
CFirst& m_First;
};
BEGIN_MESSAGE_MAP(CSecond, CDialog)
ON_EN_CHANGE(IDC_EDIT_SECOND, &CSecond::OnEnChangeEdit)
END_MESSAGE_MAP()
void CSecond::OnEnChangeEdit()
{
CString s;
GetDlgItemText(IDC_EDIT_SECOND, s);
m_first.SecondChanged(s)
}
becuase in the SetDlgItemText() function internally check for the
IsWindow(m_hWnd) which has a 0(NULL) value and its throwing a
exception. how come i will override this problem. Kindly help me.
ENSURE(this);
ENSURE(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL));
i was tried to get the window handle of the FirstDialog but it also
hold the null value,
as Joseph said when i displied the Second dialog, first dailog doent
know any thing about the firstdailog. thats why when we are calling
the m_first.SecondChanged(s) function First Dialog doesnt know about
this and has Null m_hWnd.
Kindly help me out to resolve this problem.
Thanks,
Rs.