Board index » delphi » COM constructors / destructors ..

COM constructors / destructors ..

Hello;

Whilst experimenting with COM (for the first time), I have hit a snag. I
would like the COM object to perform some actions in its initialisation and
destruction.

I have added 'Constructor Create' and Destructor Destory' events to the COM
object, but that code never gets compiled! I have also tried to implement
the 'AfterConstruction' event, but get the same outcome.

My only current option is to Create two new methods and actively call them
from the Client!

If you can offer any advice I'd be very grateful,
Thanking-you

Marc Adams
Software Development - Voice Processing
Lucent Technologies

E-Mail:    M.Ad...@sdxplc.com
Website:  www.sdxplc.com

 

Re:COM constructors / destructors ..


public
    procedure initialize; override;
    destructor Destroy; override;
end;
..
procedure initialize;
begin
    inherited Initialize;
    ..
end;

Destructor Destroy;
begin
    ..
    inherited Destroy;
end;

Marc Adams <M.Ad...@sdxplc.com> escribi en el mensaje de noticias
7jgafv$1...@forums.borland.com...

Quote
> Hello;

> Whilst experimenting with COM (for the first time), I have hit a snag. I
> would like the COM object to perform some actions in its initialisation
and
> destruction.

> I have added 'Constructor Create' and Destructor Destory' events to the
COM
> object, but that code never gets compiled! I have also tried to implement
> the 'AfterConstruction' event, but get the same outcome.

> My only current option is to Create two new methods and actively call them
> from the Client!

> If you can offer any advice I'd be very grateful,
> Thanking-you

> Marc Adams
> Software Development - Voice Processing
> Lucent Technologies

> E-Mail:    M.Ad...@sdxplc.com
> Website:  www.sdxplc.com

Re:COM constructors / destructors ..


Thank you, I'll try this out tonight

Marc Adams

Quote
Javier wrote:
> public
>     procedure initialize; override;
>     destructor Destroy; override;
> end;
> ..
> procedure initialize;
> begin
>     inherited Initialize;
>     ..
> end;

> Destructor Destroy;
> begin
>     ..
>     inherited Destroy;
> end;

> Marc Adams <M.Ad...@sdxplc.com> escribi en el mensaje de noticias
> 7jgafv$1...@forums.borland.com...
> > Hello;

> > Whilst experimenting with COM (for the first time), I have hit a snag. I
> > would like the COM object to perform some actions in its initialisation
> and
> > destruction.

> > I have added 'Constructor Create' and Destructor Destory' events to the
> COM
> > object, but that code never gets compiled! I have also tried to implement
> > the 'AfterConstruction' event, but get the same outcome.

> > My only current option is to Create two new methods and actively call them
> > from the Client!

> > If you can offer any advice I'd be very grateful,
> > Thanking-you

> > Marc Adams
> > Software Development - Voice Processing
> > Lucent Technologies

> > E-Mail:    M.Ad...@sdxplc.com
> > Website:  www.sdxplc.com

Other Threads