| 56 | | ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] |
|---|
| 57 | | CoClass = gencache.GetClassForProgID(ClassIndex) |
|---|
| 58 | | if not CoClass: |
|---|
| 59 | | # Well, we might not have a cached one... so lets go find the TypeLib |
|---|
| 60 | | dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) |
|---|
| 61 | | tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() |
|---|
| 62 | | # Now gencache it |
|---|
| 63 | | CoTLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) |
|---|
| 64 | | # And try Aagain |
|---|
| 65 | | CoClass = gencache.GetClassForProgID(ClassIndex) |
|---|
| 66 | | if not CoClass: |
|---|
| 67 | | # Dang... still didn't work |
|---|
| 68 | | raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) |
|---|
| | 56 | CoClass = self.GetAXControlCoClass() |
|---|
| | 76 | #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 77 | |
|---|
| | 78 | def GetAXControlCoClass(self): |
|---|
| | 79 | ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] |
|---|
| | 80 | CoClass = gencache.GetClassForProgID(ClassIndex) |
|---|
| | 81 | if not CoClass: |
|---|
| | 82 | # Well, we might not have a cached one... so lets go find the TypeLib |
|---|
| | 83 | dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) |
|---|
| | 84 | tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() |
|---|
| | 85 | # Now gencache it |
|---|
| | 86 | TLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) |
|---|
| | 87 | # And try Aagain |
|---|
| | 88 | CoClass = gencache.GetClassForProgID(ClassIndex) |
|---|
| | 89 | if not CoClass: |
|---|
| | 90 | # Dang... still didn't work |
|---|
| | 91 | raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) |
|---|
| | 92 | return CoClass |
|---|
| | 93 | |
|---|
| | 94 | def GetAXControlModule(self): |
|---|
| | 95 | ClassIndex = self.settings.get('progid', None) or self.settings['clsid'] |
|---|
| | 96 | module = gencache.GetModuleForProgID(ClassIndex) |
|---|
| | 97 | if not module: |
|---|
| | 98 | # Well, we might not have a cached one... so lets go find the TypeLib |
|---|
| | 99 | dis = dynamic.Dispatch(pywintypes.IID(ClassIndex)) |
|---|
| | 100 | tlbAttr = dis._lazydata_[0].GetContainingTypeLib()[0].GetLibAttr() |
|---|
| | 101 | # Now gencache it |
|---|
| | 102 | TLB = gencache.EnsureModule(tlbAttr[0], tlbAttr[1], tlbAttr[3], tlbAttr[4]) |
|---|
| | 103 | # And try Aagain |
|---|
| | 104 | module = gencache.GetModuleForProgID(ClassIndex) |
|---|
| | 105 | if not module: |
|---|
| | 106 | # Dang... still didn't work |
|---|
| | 107 | raise KeyError, "ActiveX class not found for %r (%r)" % (ClassIndex, ) |
|---|
| | 108 | return module |
|---|
| | 109 | |
|---|