Announcement

Collapse
No announcement yet.

How to stop COM programs from terminating?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to stop COM programs from terminating?

    I've noticed the COM examples automatically release the interface before
    you can do anything. If you want the user to end the program from
    Excel for example do you use WaitForSingleObject? Placing a message box before releasing the interface works, but not very sophisticated.
    How long is an idea?

  • #2
    Hi Mike!

    Far as I know, all you need do is remove obj.Quit type calls, etc. Then the Exe Server App will just keep running and the user can do what he/she wants with it.
    Fred
    "fharris"+Chr$(64)+"evenlink"+Chr$(46)+"com"

    Comment


    • #3
      Unless somebody says differently, that is too easy.
      Thought what you create you must destroy.
      Thanks!

      Code:
      ' Msgbox "Click here to terminate"
      Terminate:
      ' Close the current document and then close EXCEL completely
      OBJECT CALL oExcelApp.ActiveWindow.CLOSE
      OBJECT CALL oExcelApp.Quit
      ' Release the interfaces. We could omit this since the
      ' app is about to close, but "best practice" states we
      ' should clean our house before moving out.
      SET oExcelApp = NOTHING
      SET oExcelWorkbook = NOTHING
      SET oExcelWorkSheet = NOTHING
      How long is an idea?

      Comment

      Working...
      X