Borland C++Builder 6 MDI Application -


i made ​​an mdi application in borland c++builder 6.

i made 2 forms:

  1. the main form
  2. 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

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -