BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OnDestroy never called in TActiveForm

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc
View previous topic :: View next topic  
Author Message
Sonnich
Guest





PostPosted: Fri Sep 02, 2005 1:14 pm    Post subject: OnDestroy never called in TActiveForm Reply with quote



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?

S

Back to top
Tony Mountifield
Guest





PostPosted: Wed Sep 07, 2005 11:04 am    Post subject: Re: OnDestroy never called in TActiveForm Reply with quote



In article <1125666868.872116.88930 (AT) g49g2000cwa (DOT) googlegroups.com>,
Sonnich <sonnich.jensen (AT) elektrobit (DOT) com> wrote:
Quote:
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: [email]tony (AT) softins (DOT) co.uk[/email] - http://www.softins.co.uk
Play: [email]tony (AT) mountifield (DOT) org[/email] - http://tony.mountifield.org

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.misc All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.