User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Using an existing instance »
Welcome, Guest. Please Login or Register.
May 9th, 2025, 9:04am


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Scripting Questions
(Moderator: Jamie OConnell)
   Using an existing instance
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   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 Quote Modify 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
*****






   
WWW Email

Gender: male
Posts: 2027
Re: Using an existing instance
« Reply #1 on: Jan 27th, 2004, 3:26pm »
Quote Quote Modify 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 Quote Modify 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
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


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