[ pywin32-Bugs-2726657 ] getting PyIUnknown for a known return typeâ
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2009-04-02 12:01:58
|
Bugs item #2726657, was opened at 2009-04-02 14:01 Message generated for change (Tracker Item Submitted) made by kpoman You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2726657&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: com Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Patricio Stegmann (kpoman) Assigned to: Nobody/Anonymous (nobody) Summary: getting PyIUnknown for a known return type Initial Comment: Hello all, I am getting a strange behaviour for a generated clsid: class IAcquisitionDevice(DispatchBaseClass): # SOME CODE STRIPPED HERE # Result is of type IAcquisitionDeviceInfo def EnumerateDevices(self): return self._ApplyTypes_(1610743823, 1, (8201, 0), (), u'EnumerateDevices', '{7ED03FE9-4DCC-4F5D-BDF8-4D4D22C1FA10}',) def GetNumberOfDevices(self): return self._oleobj_.InvokeTypes(1610743822, LCID, 1, (3, 0), (),) # SOME CODE STRIPPED HERE # THEN SOME LINES LATER class IAcquisitionDeviceInfo(DispatchBaseClass): CLSID = IID('{7ED03FE9-4DCC-4F5D-BDF8-4D4D22C1FA10}') coclass_clsid = IID('{DDD89560-8B0E-4D6F-9BDF-7E14068C1DEB}') _prop_map_get_ = { "Properties": (1610743809, 2, (8, 0), (), "Properties", None), "SerialNumber": (1610743808, 2, (8, 0), (), "SerialNumber", None), } _prop_map_put_ = { } I saved all this on a mk4 file. Then I perform some tests: >>> import mk4 >>> dev = mk4.AcquisitionDevice() >>> print dev.GetNumberOfDevices() 1 >>> print dev.EnumerateDevices() (<PyIUnknown at 0x00BCB4C0 with obj at 0x0509FF90>,) >>> I dont know why I am getting a PyIUnknown if it should now I am returning IAcquisitionDevice object ! I guess there is some error somewhere and I really need to fix it. From that ActiveX documentation I see this: void EnumerateDevices (AcquisitionDeviceInfo infos[]) enumerate all connected acquisition devices So it should return an array of infos and not only one info (this array contains infos for all the different compatible devices). So somehow the python cache file got wrongly generated. How can I fix this please ? How to declare it should be an array of deviceinfos instead of a single deviceinfo ? Thank you all for any help, Patricio ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2726657&group_id=78018 |