INTERACT FORUM

Please login or register.

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

Author Topic: Can't get SDK automation interface to work  (Read 621 times)

RhinoBanga

  • Guest
Can't get SDK automation interface to work
« on: March 28, 2002, 11:31:03 pm »

Hi,

After discovering MJ had an automation interface today I decided to have a look at it.

Unfortunately I cannot seem to get it to work.

I am using Windows XP Pro, MJ 8.0.237 and VB 6.0 with MediaJukebox selected as one of the available references.

Running the simple code below produces the error "ActiveX component can't create object" when issuing the Set command:

Private Sub Form_Load()
Dim CMJAutomation As New MJAutomation
Dim CMJFilesAutomation As MJFilesAutomation

   Set CMJFilesAutomation = CMJAutomation.Search("A")
   Debug.Print CMJFilesAutomation.GetNumberFiles

End Sub


I get the same error if I try this:

Private Sub Form_Load()
Dim CMJAutomation As MJAutomation

   Set CMJAutomation = New MJAutomation

End Sub



Now MJ is running and playing songs in the background while I try this.

I'm sure I must be doing something silly but any ideas anyone?



RhinoBanga.
Logged

Nikolay

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1681
  • Former CTO, JRiver, Inc.
RE:Can't get SDK automation interface to work
« Reply #1 on: March 29, 2002, 04:23:21 am »

RhinoBanga,

Media Jukebox automation objects cannot be used from outside of Media Jukebox, in other words you have to create a plug-in for MJ. Automation interface can be accessed by Interface plug-ins and Display plug-ins. In both cases you have to implement public function which looks like that:

Public g_MJ As MediaJukebox.MJAutomation

Public Function Init(ByVal MediaJukebox As Object)
   
   ' set the global Media Jukebox object on init
   ' (Media Jukebox will call this function when the plugin starts)
   Set g_MJ = MediaJukebox
   
End Function

Take a look at Interface plug-in SDK it includes VB sample.

Regards,
Nikolay
Logged

RhinoBanga

  • Guest
RE:Can't get SDK automation interface to work
« Reply #2 on: March 29, 2002, 05:00:45 am »

Thanks Nikolay ... I'm going to try and control MJ from the IRC program "Klient" (www.klient.com)



RhinoBanga.
Logged
Pages: [1]   Go Up