[python-win32] PyIEnumMoniker

Mark Hammond mhammond at skippinet.com.au
Thu Sep 20 03:54:24 CEST 2007


> Can someone tell me how to use PyIEnumMoniker?
> I've tried :
> import pythoncom
> 
> print PyIEnumMoniker.Next()
> but I get the error:
> 
>  NameError: global name 'PyIEnumMoniker' is not defined.

IEnumMoniker is just a COM interface - generally an object implementing that
interface will be returned from a function call, or in some cases, you might
be expected to provide an implementation and pass it to some object.

The standard "Running Object Table" does return this interface though, so
for an example, try:

>>> import pythoncom
>>> rot=pythoncom.GetRunningObjectTable()
>>> e=rot.EnumRunning()
>>> e.Next()
(<PyIMoniker at 0x01303378 with obj at 0x0018B488>,)
>>>

Mark



More information about the python-win32 mailing list