[pywin32-bugs] [ pywin32-Bugs-2174265 ] return object from method fails
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-01-28 05:23:54
|
Bugs item #2174265, was opened at 2008-10-17 01:58 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2174265&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: Closed >Resolution: Invalid Priority: 5 Private: No Submitted By: Enrico (enrico-b) Assigned to: Nobody/Anonymous (nobody) Summary: return object from method fails Initial Comment: From pippo.idl (in test directory) HRESULT Method1([out, retval] IPippo **val) When called from C++ there's an exception I attach a client written with python and comtypes and, with a little effort I can see the problem is a call to QueryInterface with IID_NULL (as happens if the caller is a C++ client). client: pippo-test.py To show the problem I registered the pippo_server with the --debug option. Then I changed the function Method1 in this way to have a debug output: def Method1(self): #return wrap(CPippo()) return wrap(CPippo(),useDispatcher=1) Last, in the file policy.py at line 261, at the begin of the _QueryInterface_ function I added a line: print iid The result in PythonWin trace Collector is: Object with win32trace dispatcher created (object=None) Object with win32trace dispatcher created (object=<pippo_server.CPippo instance at 0x015DF210>) {00000000-0000-0000-0000-000000000000}Traceback (most recent call last): File "C:Python25Libsite-packageswin32comserverdispatcher.py", line 41, in _QueryInterface_ return self.policy._QueryInterface_(iid) File "C:Python25libsite-packageswin32comserverpolicy.py", line 261, in _QueryInterface_ print iid com_error: (-2147221005, "Stringa dell'interfaccia non valida.", None, None) pythoncom error: Failed to call the universal dispatcher ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-01-27 21:23 Message: I think this is a problem in the caller - I don't think there is a requirement for objects to return something when queried with IID_NULL. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2174265&group_id=78018 |