Hi all,
I have a bpl in which I share an instance of a class (or unit) that implements section initialization and finalization.
In the initialization section, the class (inherited from TApplication) creates itself.
Here's a skeleton of my class:
-----------------------------------------------------------
type
TclsAppIntf = class(TApplication)
// private and public declarations...
end;
var oApp: TclsAppIntf;
implementation
//code of the class...
initialization
oApp := TclsAppIntf.Create(Application);
finalization
// No need to free the object descending from TApplication
//oApp.Free;
-----------------------------------------------------------
If the initialization section is there (that is, calling the constructor of the class), RAD Studio 2007 raises access violation within a IDE modal form (like the AboutBox form) when switching back to the task. Anyway, the point is, RAD Studio doesn't like it (while BDS 2006 does).
So, I need to create an instance of my class within my bpl. In fact, I was using initialization
section as the entry point of my bpl (each vcl uses the same shared class instance)
Is there another entry point in a bpl from where I could instantiate my object?
That is, only one place to call the constructor of TclsAppIntf?
Thanks a lot for help,
RC
I have a bpl in which I share an instance of a class (or unit) that implements section initialization and finalization.
In the initialization section, the class (inherited from TApplication) creates itself.
Here's a skeleton of my class:
-----------------------------------------------------------
type
TclsAppIntf = class(TApplication)
// private and public declarations...
end;
var oApp: TclsAppIntf;
implementation
//code of the class...
initialization
oApp := TclsAppIntf.Create(Application);
finalization
// No need to free the object descending from TApplication
//oApp.Free;
-----------------------------------------------------------
If the initialization section is there (that is, calling the constructor of the class), RAD Studio 2007 raises access violation within a IDE modal form (like the AboutBox form) when switching back to the task. Anyway, the point is, RAD Studio doesn't like it (while BDS 2006 does).
So, I need to create an instance of my class within my bpl. In fact, I was using initialization
section as the entry point of my bpl (each vcl uses the same shared class instance)
Is there another entry point in a bpl from where I could instantiate my object?
That is, only one place to call the constructor of TclsAppIntf?
Thanks a lot for help,
RC