From: SourceForge.net <no...@so...> - 2011-01-07 07:57:17
|
Bugs item #3152800, was opened at 2011-01-07 08:57 Message generated for change (Tracker Item Submitted) made by kahlbutz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3152800&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: Klaus Noekel (kahlbutz) Assigned to: Nobody/Anonymous (nobody) Summary: gen_py fails to map type correctly Initial Comment: Hi, I am calling a COM server (written in C++) from Python. The COM server defines methods: interface IMatrix : IDispatch { ... [id(14), helpstring ("Copy matrix contents to a pointer to a C-style 2D double array")] HRESULT GetValuesRaw ( [in] unsigned int hi, [in] unsigned int lo); [id(15), helpstring ("Copy matrix contents from a pointer to a C-style 2D double array")] HRESULT SetValuesRaw ( [in] unsigned int hi, [in] unsigned int lo); } Pywin32 does not pick up the unsigned int, but generates def GetValuesRaw(self, hi=defaultNamedNotOptArg, lo=defaultNamedNotOptArg): """Copy matrix contents to a pointer to a C-style 2D double array""" return self._oleobj_.InvokeTypes(14, LCID, 1, (24, 0), ((3, 1), (3, 1)),hi , lo) where the type id 3 stands for VT_I4 instead of VT_UI4. As you would expect this fails the first time bit 31 of hi or lo is set. Is it a bug in pywin32? If not, how can I influence gen_py so that it correctly recognizes the type? Do I have to write the IDL differently? Can I include hints? Finally, what I really want to achieve is pass a 64-bit pointer from Python to the C++ COM server. Splitting it into the 32-bit hi/lo parts and passing them separately is my current solution. Am I overlooking a better option? Thanks and best regards, Klaus Noekel ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3152800&group_id=78018 |