Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent & Children in C++Builder

Status
Not open for further replies.

Royt

IS-IT--Management
Jan 31, 2000
61
0
0
GB
I want to display one instance of any of several child forms and switch between them.<br><br>snippet from main form (frmTest fsMDIForm, frmPage1 fsMIDChild) ...<br><br>void __fastcall TfrmTest::page11Click(TObject *Sender)<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;if (!Page1)<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TfrmPage1 *frmPage1 = /bnew/b TfrmPage1(/bthis/b);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Page1 = /btrue/b;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmPage1-&gt;Show();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;frmPage1-&gt;BringToFront();<br>}<br><br>where /bbool/b Page1 is initially /bfalse/b, and Page1 is doing nothing.<br><br>Instance is created OK, but when the menu item is clicked a second time ERROR!<br><br>Access violation at address 41303AE6 in module 'VCL35.BPL'. Read of address FFFFFFFF.<br><br>Am I doing something stupid?<br><br>Any suggestions would be welcomed.<br><br>Roy Thomas.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top