[pywin32-bugs] [ pywin32-Patches-3519768 ] Allow multiple type libraries
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-11-24 05:23:27
|
Patches item #3519768, was opened at 2012-04-20 02:08 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=3519768&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: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: YanXu (stelzbock) Assigned to: Nobody/Anonymous (nobody) Summary: Allow multiple type libraries Initial Comment: As explained in my post to the python-win32 mailing list ("How to write a COM Server implementing interfaces from type lib?"), I have patched the policy.py to support multiple type libraries. This should work in parralel to the exisisting one-type-lib feature. Using the changed version, a new attribute can be used in the COM implementation class called "_typelib_interfaces_". This attributes is expected to be a list tuplse of the library CLSID string, the major and minor version, the LCID and a list of Interface strings. Here is an example I used in my server: class OPCServer(): (...some other attributes...) _typelib_interfaces_ = [ ("{3B540B51-0378-4551-ADCC-EA9B104302BF}", 3, 0, 0, [ 'IOPCServer', 'IOPCItemProperties', ] ), ("{B28EEDB1-AC6F-11D1-84D5-00608CB8A7E9}", 1, 0, 0, [ 'IOPCCommon', 'IConnectionPointContainer' ] ) ] Actually, the patch includes some comment that say "PATCH START". ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-11-23 21:23 Message: I'm very sorry for the delay in looking at this. Wouldn't it be possible to implement this by just allowing a new, say _typelibs_ attribute, which is a list of (guid, major_ver, minor_ver) tuples, then have _build_typeinfos_ search all specified typelibs for the interfaces? It seems like that would make for a less-intrusive patch and allow us to deprecate _typelib_guid_ and _typelib_version_ for _typelibs_. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551956&aid=3519768&group_id=78018 |