def Connect(self, coInstance, eventInstance, eventCLSID = None):
try:
oleobj = coInstance._oleobj_
except AttributeError:
oleobj = coInstance
cpc=oleobj.QueryInterface(pythoncom.IID_IConnectionPointContainer)
if eventCLSID is None: eventCLSID = eventInstance.CLSID
comEventInstance = self._wrap(eventInstance)
self.cp=cpc.FindConnectionPoint(eventCLSID)
self.cookie = self.cp.Advise(comEventInstance)
评论列表
文章目录