Re: OnDestroy never called in TActiveForm
- From: tony@xxxxxxxxxxxxxxxxxxx (Tony Mountifield)
- Date: Wed, 7 Sep 2005 11:04:55 +0000 (UTC)
In article <1125666868.872116.88930@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Sonnich <sonnich.jensen@xxxxxxxxxxxxxx> wrote:
> Hi!
>
> I have and active x from (TActiveForm), which includes different
> things....
> The point it, that there is an OnCreate event, which works...
>
> however, the OnDestroy is never called....
>
> have anyone worked with this?
>
> I get some funny action, when the programme is being closed, as I
> cannot close all my stuff (e.g. a thread).
>
> Any ideas anyone?
Yes, first look at the end of the interfaces section for the following
declaration in the class of your main form (by default TActiveFormX):
procedure Initialize; override;
and just after it, add:
procedure BeforeDestruction; override;
Then in the implementation section, add the follwing procedure:
procedure TActiveFormX.BeforeDestruction;
begin
OnDestroy := ActiveFormDestroy;
inherited;
end;
Where TActiveFormX is the class type of your main form.
See http://groups.google.co.uk/group/borland.public.delphi.com.activex.writing/browse_frm/thread/19e6d7310deadd18/83a386efcd8653e0 for my original posting on this topic.
Cheers
Tony
--
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
.
- References:
- OnDestroy never called in TActiveForm
- From: Sonnich
- OnDestroy never called in TActiveForm
- Prev by Date: Re: 2005 availabilty
- Next by Date: Re: 2005 availabilty
- Previous by thread: OnDestroy never called in TActiveForm
- Next by thread: Re: Help for use a DLL
- Index(es):