[python-win32] Re: get active process list crashes

Roger Upole rwupole at msn.com
Fri Aug 24 05:29:27 CEST 2007


Radu Ciora wrote:
> Hi all,
>
> when I try to call  GetObject('winmgmts:') when an input event happens, I get the following exception:
>
>   File "D:\DAProject\Workspace\context\inputhook\RDFIO.py", line 67, in wordInfo
>     self.GetActiveProcess()
>   File "D:\DAProject\Workspace\context\inputhook\RDFIO.py", line 71, in GetActiveProcess
>     l_WMI = GetObject('winmgmts:')
>   File "c:\Python24\Lib\site-packages\win32com\client\__init__.py", line 73, in GetObject
>     return Moniker(Pathname, clsctx)
>   File "c:\Python24\Lib\site-packages\win32com\client\__init__.py", line 88, in Moniker
>     moniker, i, bindCtx = pythoncom.MkParseDisplayName(Pathname)
> pywintypes.com_error: (-2147417843, 'An outgoing call cannot be made since the application is dispatching an input-synchronous
> call.', None, None)
>
> Any help really appreciated.
 >
> Thanks a million,
> Radu

Events are processed synchronously, so basically you can't make that call while the event code
is running.  You might be able to use a win32 event or a timer to signal the main program to
perform the WMI operation.

           Roger




More information about the python-win32 mailing list