Python pywin32 TypeError: There is no interface object registered that supports this IID

Viewed 93

I'm trying to call CoCreateInstance. I get the error TypeError: There is no interface object registered that supports this IID. I read in the docs that I need to create (I believe) an IDispatch object. Trouble is it needs to be called on an IPyUnknownObject and I don't know how to get that. Or am I off?

import pythoncom
import pywintypes


clsid = pywintypes.IID('{9BA05972-F6A8-11CF-A442-00A0C90A8F39}')  # CLSID_ShellWindow
iid = pywintypes.IID('{85CB6900-4D95-11CF-960C-0080C7F4EE85}')  # IID_IShellWindow
pythoncom.CoCreateInstance(clsid, None, pythoncom.CLSCTX_ALL, iid)
0 Answers
Related