|
-
Nov 25th, 2003, 06:14 AM
#1
Thread Starter
Addicted Member
Please help with ActiveX exe
Hi
I have a program that instansiates an ActiveX exe when it runs. Sometimes, if my program is busy, opening a recordset for instance, and I end my programs task, the ActiveX exe remain running.
Is there a way to ensure that my ActiveX exe quits whenever my client program quits, crashes etc.?
Thanks.
-
Nov 25th, 2003, 08:00 AM
#2
-= B u g S l a y e r =-
set the object to nothing in your main forms unload event ?
-
Nov 25th, 2003, 08:05 AM
#3
Thread Starter
Addicted Member
Thanks for your reply.
I do set the object to nothing when my application is closed normally, but if it crashes, my ActiveX exe keeps running. I need it to close if my application is stopped abnormally.
-
Nov 25th, 2003, 08:25 AM
#4
-= B u g S l a y e r =-
so the main form is not unloaded when the app crashes ?
-
Nov 25th, 2003, 08:29 AM
#5
-= B u g S l a y e r =-
forget I said that... tested it ... it does not unload.
then my answer is, I do not know the answer....
-
Nov 25th, 2003, 08:42 AM
#6
You could pass in the hWnd of the calling form, then periodically test if the window still exists using IsWindow.
VB Code:
Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 25th, 2003, 12:05 PM
#7
Thread Starter
Addicted Member
That's a really cool idea...
...but is it not possible that the hWnd of a form can change during the course of the programs execution?
-
Nov 25th, 2003, 12:39 PM
#8
No. Unless you are dealing with another instance of the form, it will remain constant until the form is closed.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|