Launching multiple instances of a program with win32com.client.Dispatch?

Roger Upole rupole at hotmail.com
Thu Jul 6 23:39:32 EDT 2006


win32com.client.DispatchEx should create a new instance.

       Roger

<tyler.schlosser at gmail.com> wrote in message news:1152238469.455365.239520 at s26g2000cwa.googlegroups.com...
> Hi there, I am trying to launch a program called AmiBroker using the
> command:
>
> AB = win32com.client.Dispatch("Broker.Application")
>
> However, I have a dual-core CPU and would like to launch two instances
> of AmiBroker. I know it is possible to run two instances simultaneously
> since it is easy to do manually by double-clicking the AmiBroker.exe
> file twice. However, when I write two lines of code like this:
>
> AB = win32com.client.Dispatch("Broker.Application")
> AB2 = win32com.client.Dispatch("Broker.Application")
>
> and proceed to address these objects, they interfere with each other
> since both AB and AB2 are "grabbing" the same instance of AmiBroker. If
> I try to run two separate Python scripts, each one containing a
> "win32com.client.Dispatch("Broker.Application")" comand, the same
> problem happens (where even though the objects are named differently,
> they do not each launch an instance of the program; the first one
> launches it and the second one just "grabs" it).
>
> Does anyone know how to force two separate program launches rather than
> having both Dispatch commands access the same object? I would be
> incredibly thankful to anyone who could offer some help with this.
>
> Thank you very much,
>
> Tyler
> 





More information about the Python-list mailing list