INTERACT FORUM

Please login or register.

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

Author Topic: Problem using MC13's COM interface  (Read 1385 times)

prod

  • Citizen of the Universe
  • *****
  • Posts: 958
  • Play nice
Problem using MC13's COM interface
« on: June 04, 2009, 04:39:24 am »

There appears to be something up with MC and its COM interface that can be demonstrated simply with the following javascript;

Code: [Select]
var oMC = WScript.CreateObject("MediaJukebox Application");
WScript.DisconnectObject(oMC);
oMC = null;

This code will run over and over with no problems as long as MC was not running before running the javascript.

However, run MC first and then run the script. The script runs OK first time, but subsequent runs don't work (there is a timeout - you should eventually see an error dialog).
Logged

cncb

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2925
Re: Problem using MC13's COM interface
« Reply #1 on: June 04, 2009, 06:52:57 am »

You need to see if the object is already running like so:

Code: [Select]
 
try
{
      // See if it is running already
      jrmc = GetObject("", "MediaJukebox Application");
}
catch(err)
{
// Try to start it
        try
        {
             jrmc = new ActiveXObject("MediaJukebox Application");
           
        }
catch( err){}
}

if( jrmc != null)
{
   // Do something...
}
Logged
-Craig    MO 4Media remote and player:  Android/TV/Auto | iOS | Windows 10/UWP

prod

  • Citizen of the Universe
  • *****
  • Posts: 958
  • Play nice
Re: Problem using MC13's COM interface
« Reply #2 on: June 04, 2009, 07:07:18 am »

Thanks for that! I was stuck on releasing the object and never thought to change the way I instantiate it.
Logged
Pages: [1]   Go Up