Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: win32com.client.Dispatch("WScript.Shell")

Reply
Thread Tools

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

 
 
Tim Golden
Guest
Posts: n/a
 
      07-16-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
__________________________________________________ ______________________
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments