Results 1 to 8 of 8

Thread: Please help with ActiveX exe

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Peterborough, Cambs, England
    Posts
    176

    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.

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    set the object to nothing in your main forms unload event ?
    -= a peet post =-

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Peterborough, Cambs, England
    Posts
    176
    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.

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    so the main form is not unloaded when the app crashes ?
    -= a peet post =-

  5. #5
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    forget I said that... tested it ... it does not unload.

    then my answer is, I do not know the answer....
    -= a peet post =-

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    You could pass in the hWnd of the calling form, then periodically test if the window still exists using IsWindow.
    VB Code:
    1. 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

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Jan 2000
    Location
    Peterborough, Cambs, England
    Posts
    176
    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?

  8. #8
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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
  •  



Click Here to Expand Forum to Full Width