Data communication between two dialogs
CListCtrl m_ListCtrl; // a member variale in dialog1
I am currently in dialog2, and I want to call dialog1, and to fill it with the data in the parent dialog.
CDialog1 dlg;
dlg.DoModal();
How shall I fill m_ListCtrl with data from dialog2?
Please tell me how to pass pointers. A piece of code will be highly appreciated.
thankyou in advance.
Re: Data communication between two dialogs
Hi!
I think you should share data at the layer of parent window. Or share method...
Best regards, Bob.
Can you elaborate it more!
I am afriad I didn't get your point enough to be able to implement it. Can you elaborate this a little more.
I appreciate your help.
Re: Data communication between two dialogs
Hi,
In Dialog1 Class provide public member function to set the values of the variables that U think need to be done from the Dilaog2 class. Then in Dilaog2, just b4 U call Dlg1.DoModal() set those values .
ex:
class Dialog1
{
private
int ValuefromDilaog2 ;
public:
void SetvaluefromDilaof2( int val )
..
..
} ;
class Dialog1::SetvaluefromDilaof2( int val )
{
ValuefromDilaog2 = val ;
}
now in Dialog 2 one function
void Dialog2::MyFunction()
{
Dilaog1 dlg1 ;
dlg1.SetvaluefromDilaof2( 123 );
dlg1.DoModal() ;
}
Hope this helps You.
Good Luck.
Yash.