MIDI-OX User Forum (http://www.midiox.com/cgi-bin/yabb/YaBB.pl)
MIDI-OX >> Scripting Questions >> Using an existing instance
(Message started by: LongShotBuddy on Jan 27th, 2004, 2:25pm)

Title: Using an existing instance
Post by LongShotBuddy on Jan 27th, 2004, 2:25pm
Hi All,

 This may end up being more of a VBScript question than a MIDI-OX question (since I'm new to both), so if so please forgive me :>/

 I have a .vbs file that creates an instance of MIDI-OX and stays resident until that instance is closed:
_____________________________________________
   (snip)

 Set objMox  = WScript.CreateObject ( "Midiox.MoxScript.1", "Sink_" )

   (snip)

 ' keep running until MIDI-OX is closed
 Do While objMox.ShouldExitScript = 0
   objMox.Sleep( 500 )
 Loop

   (snip)
__________________________________________


 I then want to be able to access and utilize this instance of MIDI-OX with another VBScript while the first is still active:

____________________________________________

  (snip)

  midiOxPath = "C:\program files\midiox\midiox.exe"

  (snip)

  Set objMox      = WScript.GetObject( midiOxPath, "Midiox.MoxScript.1" )

  (snip)
____________________________________________

 .. but .. I'm not doing something right.. I get "..Class Doesn't Support Automation.." on the .GetObject() line.. I've tried several variations of the above without any better success.. Any suggestions?  I saw the note in the docs that mention that .CreateObject() doesn't reuse an instance, but can't I still retrieve it with .GetObject()?

Thanks a bunch!

LSB

(Btw, great program! I am using to automate a band's effects, will post results when done w/ scripts. I just donated on amazon.com, suggest all other users do as well!)



Title: Re: Using an existing instance
Post by Jamie OConnell on Jan 27th, 2004, 3:26pm
I don't think you can attach to a running instance because MIDI-OX allows multiple instances and is implemented as an out-of-process server.

Maybe you could setup your subscripts as subroutines that are called from a menu or something in place of your wait loop.


Title: Re: Using an existing instance
Post by LongShotBuddy on Jan 27th, 2004, 3:49pm
Thanks for your reply Jamie!

I suppose what I could do is have the main process periodically check a directory for files containing binary sysex data.. if it finds any entries, it sends the file(s) and deletes them.. the subscripts would simply need to stick the binary data in the proper directory.

Sure appreciate the input and the program!

LSB



MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.