problem about reaching to the public member of the parent form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, i have a MdiParent form 'Form1' , and the MdiChild of this form 'Form2' .
i have already done the initialization like form2 = new Form2( );
form2->MdiParent = this;
when i try to reach the public member of the parent form 'Form1' from Form2
like temp = Form1::member; it gives error...so how can i reach the public
member of the parent form... ?
 
kkirtac said:
hi, i have a MdiParent form 'Form1' , and the MdiChild of this form
'Form2' .
i have already done the initialization like form2 = new Form2( );
form2->MdiParent = this;
when i try to reach the public member of the parent form 'Form1' from
Form2
like temp = Form1::member; it gives error...so how can i reach the public
member of the parent form... ?

You have to cast 'form2->MdiParent' to the type of the parent form and call
the method on the casted reference.
 
Back
Top