how to use Dispatch to open an application in win32com.client

Tim Golden mail at timgolden.me.uk
Wed May 2 14:57:48 EDT 2007


Peter Fischer wrote:
> Hello,
> 
> I also use the COM API via python to dispatch an application. My
> problem now is that I want to dispatch a second instance of this
> application (Google Earth by the way). But when I invoke dispatch
> the second time, nothing happens although using another variable to
> store the returned value:
> 
> GE_1 =  win32com.client.Dispatch("GoogleEarth.ApplicationGE")
> 
> GE_2 =  win32com.client.Dispatch("GoogleEarth.ApplicationGE")
> 
> (import and while not .IsInitialized() statements omitted for brevity)
> 
> Does anyone know how to start a second, third, and so on, instance of
> the application?

Suspect you want win32com.client.DispatchEx which, among
other things, starts a separate instance of the app. (Or
whatever they call the things in COMspeak).

GE_n = win32com.client.DispatchEx ("GoogleEarth.ApplicationGE")

TJG



More information about the Python-list mailing list