INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: How to close/quit/shutdown an instance of MC started from MJAutomation?  (Read 1582 times)

salsbst1

  • Regular Member
  • World Citizen
  • ***
  • Posts: 244

How do I close/quit/shutdown an instance of MC that was started from MJAutomation (other than by killing the task)?  I guess in the days of "no access to the automation interface from out of process" this wasn't very important...
Logged

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer

Which language?

If it's VB you have to set the MC instance to Nothing, e.g.:


Private Sub Command1_Click()
    On Error Resume Next

    Dim myMC As MediaJukebox.MJAutomation

    Set myMC = GetObject(, "MediaJukebox Application")
    If Err.Number = 429 Then
        Err.Clear
        Set myMC = CreateObject("MediaJukebox Application")
    End If

    If Err.Number Then
        MsgBox "Could not start MC - " & Err.Description
    Else
        '  Get rid of MC
        Set myMC = Nothing
    End If

End Sub



If it's C/C++ you have to make sure you release the COM object.

But I believe if you start up MC via COM then start it up manually then close your COM connection MC will still hang around.   Although don't hold me to that.
Logged

salsbst1

  • Regular Member
  • World Citizen
  • ***
  • Posts: 244

Thanks for your response.  I just tested and it works fine in VB.

I'm actually using Java (not JavaScript).  There may be something wrong with the COM bridge (Jacob) or the wrapper that I generated (JacobGen) which is causing the COM reference count not to be decremented.

Logged
Pages: [1]   Go Up