INTERACT FORUM

Please login or register.

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

Author Topic: Why Does It Crash Media Center? And How Do I Fix It?  (Read 1381 times)

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Why Does It Crash Media Center? And How Do I Fix It?
« on: October 25, 2004, 01:20:52 pm »

This Is The whole Program, When I Load It Up And Then Terminate Media Center Media Center Will Continue To Run In The Task Manage But Is No Longer Visable.

If I Remove

    If Err.Number = 429 Then                                  '
        Set MYMJ = CreateObject("MediaJukebox Application")   '
    End If

then It Works Fine But This Was The Recomended Code In The SDK

Is There A Way To Fix This?

If So What Do I Need To Do?


************************************************

'Rem Set Up For MJAutomation
Public MYMJ As MediaJukebox.MJAutomation
Option Explicit
Private Sub UserControl_Show()
    ' Do Nothing At All
End Sub

Public Function Init(ByVal MediaJukebox As Object) As Variant
    On Error Resume Next
    ' set the global Media Jukebox object on init                    '
    ' (Media Jukebox will call this function when the plugin starts) '
    ' Set MYMJ = MediaJukebox                                        '
    Set MYMJ = GetObject(, "MediaJukebox Application")        '
    If Err.Number = 429 Then                                  '
        Set MYMJ = CreateObject("MediaJukebox Application")   '
    End If
End Function
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:Why Does It Crash Media Center? And How Do I Fix It?
« Reply #1 on: October 26, 2004, 02:16:50 am »

Try

  Set MYMJ = Nothing

In the terminate function.
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20048
Re:Why Does It Crash Media Center? And How Do I Fix It?
« Reply #2 on: October 26, 2004, 05:53:30 am »

Quote
Try

  Set MYMJ = Nothing

In the terminate function.

I did, thats how VB docs state to terminate it, but it still allows MC11 to run in the task manager but MC goes away from the desktop. i also tried that in Hide. for some rason MC11 wants to keep running if it is is in a plugin with out of prossess init code and the user terminates from the [X].

I changed it back to this (below) this was the orginal way prior to the Out-of-proc initialization code in the sdk now. It does work fine and allows mc to go away.

Public Function Init(ByVal MediaJukebox As Object) As Variant
    On Error Resume Next
    ' (Media Jukebox will call this function when the plugin starts) '
 Set MYMJ = MediaJukebox                                        '
End Function
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio
https://MyAAGrapevines.com
Fayetteville, NC, USA
Pages: [1]   Go Up