Author |
Topic: Using an existing instance (Read 1938 times) |
|
LongShotBuddy
New Member

 MIDI-OX Rules!
Posts: 3
|
 |
Using an existing instance
« on: Jan 27th, 2004, 2:25pm » |
Quote Modify
|
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!)
|
|
IP Logged |
|
|
|
Jamie OConnell
Administrator
    


Gender: 
Posts: 2027
|
 |
Re: Using an existing instance
« Reply #1 on: Jan 27th, 2004, 3:26pm » |
Quote Modify
|
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.
|
|
IP Logged |
--Jamie Music is its own reward.
|
|
|
LongShotBuddy
New Member

 MIDI-OX Rules!
Posts: 3
|
 |
Re: Using an existing instance
« Reply #2 on: Jan 27th, 2004, 3:49pm » |
Quote Modify
|
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
|
|
IP Logged |
|
|
|
|