def _QueryInterface_(self, iid): rc = DispatcherBase._QueryInterface_(self, iid) if not rc: self._trace_( "in %s._QueryInterface_ with unsupported IID %s (%s)" % (repr(self.policy._obj_), IIDToInterfaceName(iid), iid)) return rc
def _CreateInstance_(self, clsid, reqIID): """Creates a new instance of a **wrapped** object This method looks up a "@win32com.server.policy.regSpec@" % clsid entry in the registry (using @DefaultPolicy@) """ try: classSpec = win32api.RegQueryValue(win32con.HKEY_CLASSES_ROOT, regSpec % clsid) except win32api.error: raise error( "The object is not correctly registered - %s key can not be read" % (regSpec % clsid)) myob = call_func(classSpec) self._wrap_(myob) try: return pythoncom.WrapObject(self, reqIID) except pythoncom.com_error as xxx_todo_changeme: (hr, desc, exc, arg) = xxx_todo_changeme.args from win32com.util import IIDToInterfaceName desc = "The object '%r' was created, but does not support the " \ "interface '%s'(%s): %s" \ % (myob, IIDToInterfaceName(reqIID), reqIID, desc) raise pythoncom.com_error(hr, desc, exc, arg)
def BindToStorage(self, pidl, bc, iid): print("BTS", iid, IIDToInterfaceName(iid))
def _query_interface_(self, iid): from win32com.util import IIDToInterfaceName trace("PySourceModuleDebugDocumentHost QI with %s (%s)" % (IIDToInterfaceName(iid), str(iid))) return 0