Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Terminate a late Bound ActiveX EXE

Status
Not open for further replies.

Toyman

Programmer
Jun 19, 2001
68
GB
Hi
I do I Terminate a late Bound ActiveX EXE without using the
end statement

Lets say I have a form in a ActiveX EXE and if I close this form it must Terminate the ActiveX EXE.
If I use the End Statement then not all of my controls Terminate Events is fired.

Thanks
Toyman
cdt@icon.co.za
 
Make sure you have no references left to other objects including your "internal" objects. Set them all to Nothing. Get rid of all dynamic arrays e.g. Redim aryMine(0) Then the user who called you must set the reference to your module to Nothing. Only after all references to your Activex are set to nothing will the system even think about unloading you.

search on "component shutdown".
 
John,
The problem with an ActiveX EXE with a form is that even after the references to the COM Server are all destroyed, the EXE will remain in memory until the form is unloaded.

Toyman,
On option is to remove the Form from the ActiveX exe and set the startup as a Public Sub Main and then do as John suggested and destroy all references. If you have to have a Form in the ActiveX Exe, then add a function on the COM interface that the client will call that will unload the Form and shut the COM server down (still remembering to destroy all references as John suggested). - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top