[pywin32-bugs] [ pywin32-Bugs-3029949 ] Type information lost in enumeration of COM objects
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2010-07-15 16:40:39
|
Bugs item #3029949, was opened at 2010-07-15 22:09 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3029949&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: Erik Janssen (erikjanssen) Assigned to: Nobody/Anonymous (nobody) Summary: Type information lost in enumeration of COM objects Initial Comment: I am using the pywin32-214.win32-py2.7.exe distribution. I notice type information is not always available. In the following 3-line snippet 'SearchResult' is an enumerator of objects of a certain type'. Coding it like this everything is fine and python knows the type of f: for i in range(0,result.SearchResults.Count): f = result.SearchResults.Item(i) print f.StartTime, "-", f.EndTime, f.Camera.CameraName But in the following code, imho preffered, python complains about f being IUnknown and can't continue: for f in result.SearchResults: print f print f.StartTime, "-", f.EndTime, f.Camera.CameraName In the generated files (gencache) all information seems to be available, as in the IDL of the COM component. I can supply lot's of additional information but I don't know what is making sense and what isn't. ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2010-07-16 02:40 Message: Does the item have a _NewEnum method? If so, how is it defined? Otherwise I am surprised IUnknown is returned - it should behave identically to when you call Item() manually. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=3029949&group_id=78018 |