def DllGetClassObject(rclsid, riid, ppv): COMObject.__run_inprocserver__() iid = GUID.from_address(riid) clsid = GUID.from_address(rclsid) if not _logging_configured: _setup_logging(clsid) # This function is directly called by C code, and receives C # integers as parameters. rclsid is a pointer to the CLSID for the # coclass we want to be created, riid is a pointer to the # requested interface. try: _debug("DllGetClassObject(clsid=%s, iid=%s)", clsid, iid) cls = inproc_find_class(clsid) if not cls: return CLASS_E_CLASSNOTAVAILABLE result = ClassFactory(cls).IUnknown_QueryInterface(None, ctypes.pointer(iid), ppv) _debug("DllGetClassObject() -> %s", result) return result except Exception: _critical("DllGetClassObject", exc_info=True) return E_FAIL
def __init__(self, *args, **kwargs): tree.Tree.__init__(self, *args, **kwargs) COMObject.__init__(self) RegisterDragDrop(self.handle, byref(self._com_pointers_[0][1])) self.iml = comctl.ImageList(16, 16, ILC_COLOR32 | ILC_MASK, 0, 32) self.iml.AddIconsFromModule("shell32.dll", 16, 16, LR_LOADMAP3DCOLORS) self.iml.SetBkColor(gdi.CLR_NONE) self.SetImageList(self.iml) self.SetRedraw(0) item = comctl.TVITEMEX() item.text = "A root" item.image = 17 item.selectedImage = 17 item.children = 1 hRoot = self.InsertItem(comctl.TVI_ROOT, comctl.TVI_ROOT, item) for i in range(100): item.mask = 0 item.text = "A child %d" % i item.image = 3 item.selectedImage = 4 hChild = self.InsertItem(hRoot, comctl.TVI_LAST, item) self.SetRedraw(1)
def __init__(self, *args, **kwargs): list.List.__init__(self, *args, **kwargs) COMObject.__init__(self) RegisterDragDrop(self.handle, byref(self._com_pointers_[0][1])) self.InsertColumns([("blaat", 100), ("col2", 150)]) self.SetRedraw(0) for i in range(100): self.InsertRow(i, ["blaat %d" % i, "blaat col2 %d" % i]) self.SetRedraw(1)
def DllCanUnloadNow(): COMObject.__run_inprocserver__() result = COMObject.__server__.DllCanUnloadNow() # To avoid a memory leak when PyInitialize()/PyUninitialize() are # called several times, we refuse to unload the dll. return S_FALSE
def __init__(self, *args, **kwargs): COMObject.__init__(self, *args, **kwargs)
def __init__(self, dataFunc): COMObject.__init__(self) self.cfFormat = RegisterClipboardFormat(self._clipboard_format_) self.dataFunc = dataFunc
def __init__(self, cfFormat): COMObject.__init__(self) self.cfFormat = cfFormat self.i = 0
def __init__(self, pyObj, *args, **kwargs): COMObject.__init__(self, *args, **kwargs) self._disp_map_ = {} self.pyObj = pyObj