glenn007
asked on
send varibale value to parent
how can i send the value of my Edit field from a dialog to parent dialog variable id_latlon
when pushing IDC_SEND button.
what is the procedures and step needed to be taken for this
when pushing IDC_SEND button.
what is the procedures and step needed to be taken for this
ASKER
cant figure out how to do it, could you help me more
my main dialog is created in this id
CScrollBitmapDlg::CScrollB itmapDlg
and the popup dialog is created in
CCalibrate::CCalibrate(CWn d* pParent /*=NULL*/)
: CDialog(CCalibrate::IDD, pParent)
where should i insert the code to get it to work, i am having a hard time figuring out how. :(
my main dialog is created in this id
CScrollBitmapDlg::CScrollB
and the popup dialog is created in
CCalibrate::CCalibrate(CWn
: CDialog(CCalibrate::IDD, pParent)
where should i insert the code to get it to work, i am having a hard time figuring out how. :(
ASKER
this is my OnSend
void CCalibrate::OnSend()
{
this is to execute to send data to parent dialog CScrollBitmapDlg::CScrollB itmapDlg
}
void CCalibrate::OnSend()
{
this is to execute to send data to parent dialog CScrollBitmapDlg::CScrollB
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Child Dialog gets apointer to the parent
or
Parent calls function in the Child Dialog
class CMyDialog :
{
CString m_csData;
CDialog m_pParent;
SetParent ( CDialog* pParent ) { m_pParent = pParent; }
OnSend ( .. // IDC_SEND Button
{
myEdit.GetWindowText( csData );
if ( m_pParent ) // Either do this directly
m_pParent->id_latlon = csData; //better to have function
}
GetData () { return m_csData; }
};
CParentDlg parentDlg;
CMyDialog myDlg;
myDlg->SetParent ( &parentDlg );
myDlg.DoModal ();
or
CParentDlg parentDlg;
CMyDialog myDlg;
myDlg.DoModal ();
parentDlg->id_latlon = myDlg->GetData ()