Chris Bruner
2008-08-06 19:03:45 UTC
I'm getting lost in my classes and need to simplify. The biggest
simplification would be to remove delphi and just use C++, but I want to
do this a step (form) at a time.
My idea is to use dynamic creation of forms and call from the Delphi form.
That is, where the form would be dynamically created in Delphi
(for example).
function frmIFCAOptions : TfrmIFCAOptions;
begin
if (FfrmIFCAOptions = nil) then
Application.CreateForm(TfrmIFCAOptions,FfrmIFCAOptions);
if (FfrmIFCAOptions = nil) then
NoResourcesException;
Result := FfrmIFCAOptions;
end;
This function will create the form if needed and return the form once
created. (This tecnique can save a ton of memory for seldom used forms).
How would I do this with CBuilder forms, where I would create a Cbuilder
form as needed.
I was thinking of something like this, but the linker can't seem to find it.
class TForm1 : public TForm
{
__published: // IDE-managed Components
TLabel *Label1;
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
TForm *GetTForm1() { if (Form1==0) Form1 = new TForm1(Form1);
return Form1;
}
simplification would be to remove delphi and just use C++, but I want to
do this a step (form) at a time.
My idea is to use dynamic creation of forms and call from the Delphi form.
That is, where the form would be dynamically created in Delphi
(for example).
function frmIFCAOptions : TfrmIFCAOptions;
begin
if (FfrmIFCAOptions = nil) then
Application.CreateForm(TfrmIFCAOptions,FfrmIFCAOptions);
if (FfrmIFCAOptions = nil) then
NoResourcesException;
Result := FfrmIFCAOptions;
end;
This function will create the form if needed and return the form once
created. (This tecnique can save a ton of memory for seldom used forms).
How would I do this with CBuilder forms, where I would create a Cbuilder
form as needed.
I was thinking of something like this, but the linker can't seem to find it.
class TForm1 : public TForm
{
__published: // IDE-managed Components
TLabel *Label1;
TButton *Button1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
TForm *GetTForm1() { if (Form1==0) Form1 = new TForm1(Form1);
return Form1;
}