How to update editbox data in the parent dialog in child dialog created by using do modal.
Posted on 2010-01-06
I am working on VC++(MFC) dialog based application. I have an editbox in the first dialog(say dialog1). in the dialog1 there is a button, on button click event, I am launching dialog2 by using do modal (or modelless also). In the dialog2 i have another editbox, how can I update Edit1 as edit2 changes.
I have written following code in on editchange of editbox in the dlg2
//CprodexDlg *pdlg1 = (CprodexDlg*)GetParent();
CWnd* pWnd = GetParent();
CprodexDlg* pParent = STATIC_DOWNCAST( CprodexDlg, pWnd );
if ( NULL == pParent )
ASSERT( 0 );