Borland C++Builder 6 MDI Application -
i made an mdi application in borland c++builder 6.
i made 2 forms:
- the main form
- child form
i set child form available forms.
when want call child form. use following command:
application->createform(__classid(tchildform), &childform); //calling child form
why when call command again, child form 2 this?
first, don't use application->createform()
, use new
instead:
childform = new tchildform(this);
second, describe normal. creating new instance of independent child form, , see. if don't want child, don't create new one, re-use 1 have, eg:
if (!childform) { childform = new tchildform(this); } // use childform needed...
tchildform *childform = null; __fastcall tchildform::~tchildform() { childform = null; } void __fastcall tchildform::formclose(tobject *sender, tcloseaction& action) { action = cafree; }
Comments
Post a Comment