win32com.client.Dispatch("WScript.Shell")

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Jul 16 18:21:16 CEST 2004


[Bala]
>     iam creating an instance for shell..while 
> doing sometimes iam getting an error called 
> pywintypes.com_error (-2147221008, 'CoInitialize has 
> not been called.', None, None) 

Usually indicates that you're running within some kind
of threaded context. Try putting this before the call
to Dispatch (having imported pythoncom, of course):

    pythoncom.CoInitialize ()


TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list