Comtypes CHANGELOG ================== Release 1.4.16 -------------- * Decompose ``IStorage`` tests and enhance coverage. By @junkmd. * Enhance tests verifying custom ``COMObject``s raise errors. By @junkmd. * Refactor ``shelllink.py`` for ``ITEMIDLIST`` structure. By @junkmd. * Fix a code path in ``logutil.NTDebugHandler``. By @junkmd. * Add a deprecation decorator to ``logutil.setup_logging``. By @junkmd. * Add tests for connection point interfaces. By @junkmd. * Add tests for ``IGlobalInterfaceTable`` marshaling. By @junkmd. * Remove outdated Python 2.3 compatibility. By @junkmd. * Remove unused test utilities. By @junkmd. * Extract time utility test helpers. By @junkmd. * Add ``CreateTypeLib`` and ``ICreateTypeInfo`` tests. By @junkmd. * Add tests for ``VARIANTEnumerator``. By @junkmd. * Enhance tests for moniker, bind context and running object table. By @junkmd. * Introduce GDI test helper module and tests for ``IViewObject.Draw``. By @junkmd. * Unify COM descriptor release logic in ``ITypeComp.Bind``. By @junkmd. * Enhance dynamic dispatch and ``client`` testing. By @junkmd. Release 1.4.15 -------------- * Fix ``TYPE_E_ELEMENTNOTFOUND`` HRESULT constant value. By @junkmd. * Enhance ``ITypeInfo`` testing in ``test_typeinfo.py``. By @junkmd. * Improve type hints for for generated dispmethods and properties. By @junkmd. * Enhance tests for generated type hints. By @junkmd. * Remove Internet Explorer dependency from ``test_QueryService.py`` and ``test_casesensitivity.py``. By @junkmd. * Rename ``test_ie.py`` to ``test_eventinterface.py``. By @junkmd. * Fix ``SyntaxError`` in ``DispMethodAnnotator`` signature generation. By @junkmd. * Rename ``test_msi.py`` to ``test_puredispatch.py``. By @junkmd. * Rename ``test_wmi.py`` to ``test_variant_outparam.py``. By @junkmd. * Replace the module-level skip with individual ``@skip`` decorators on the test methods in ``test_eventinterface.py``. By @junkmd. * Add tests for ``stdole.IPicture`` creation through ``IStream``. By @junkmd. * Improve enum testing in ``test_client.py``. By @junkmd. * Revive and enhance ``test_outparam``. By @junkmd. * Enhance ``test_stream``. By @junkmd. * Enhance ``test_storage``. By @junkmd. * Add ``malloc`` module. By @junkmd. * Enhance and refactor COM moniker tests. By @junkmd. * Refine type hints and enhance tests for ``client.GetClassObject``, ``CoGetClassObject`` and ``IClassFactory``. By @junkmd. * Implement ``ITypeInfo.AddressOfMember`` with tests and clarifications. By @junkmd. * Enhance ``ITypeComp.Bind`` tests and type hints. By @junkmd. * Introduce warnings for Python 3.15 enum compatibility. By @junkmd. Release 1.4.14 -------------- * Replace ``setup.py`` with ``pyproject.toml``. By @moi15moi. * Update codebases for PEP585 compliance. By @junkmd. Release 1.4.13 -------------- * Remove Python 3.8 and add Python 3.14 to the CI pipelines. By @junkmd. * Declare the minimum Python version as 3.9. By @junkmd. By @junkmd. * Update ``PyCArgObject.value`` for Python 3.14 compatibility. By @junkmd. * Add version bridges for the ``__pointer_type__`` attribute protocol. By @junkmd. Release 1.4.12 -------------- * Add support for coverage. By @moi15moi. * CI/CD Improvements for runners and the codecov badge. By @junkmd. * Add signed 32-bit hexadecimal converters. By @junkmd. * Add ``Test_Stat`` to ``test_stream``. By @junkmd. * Add client-side ``RegisterActiveObject``. By @junkmd. * Remove useless ``object`` inheritance from every class. By @moi15moi. * Modernize ``super()`` calls by removing explicit class and instance arguments. By @moi15moi. * Eliminate outdated encoding boilerplates. By @moi15moi. * Update byte string creation to use ``b""`` instead of ``str.encode("utf-8")``. By @moi15moi. * Introduce ``codecov.yml``. By @moi15moi. * Migrate exception catches from older aliases to ``OSError``. By @moi15moi. * Remove obsolete Python 2 compatibility code in ``test_variant``. By @junkmd. * Skip ``test_eval`` in INPROC server tests due to instability. By @junkmd. * Adjust structure sizes and alignments for 64-bit Python in ``viewobject.py``. By @junkmd. * Add ``test_viewobject``. By @junkmd. * Ensure ``test_npsupport`` passes with ``numpy>=2.0.0`` by explicitly setting ``dtype=numpy.int32``. By @junkmd. * Add tests for ``DictPropertyBag`` and type hints for ``IPropertyBag``. By @junkmd. * Fix ``numpy`` interoperability and enable ``datetime64`` tests. By @junkmd. * Revive and correct integer handling logic for ``VARIANT``s when setting values. By @junkmd. * Add tests for ``messageloop``. By @junkmd. * Revive ``util`` and add comprehensive tests. By @junkmd. * Refactor and enhance ``util`` with explicit imports and typing. By @junkmd. * Modernize ``npsupport`` by removing the patch for the ``np._typecodes``. By @junkmd. Release 1.4.11 -------------- * Improve ``PARAMFLAG_...`` and ``DISPATCH_...`` constants definitions and imports. By @junkmd. * Introduce the ``_CDataType`` alias from typeshed. By @junkmd. * Replace ``260`` literals/constant definitions with imports from ``ctypes.wintypes.MAX_PATH``. By @junkmd. * Replace ``client._code_cache._get_module_filename`` with ``typeinfo.GetModuleFileName``. By @junkmd. * Improve ``client._code_cache.SHGetSpecialFolderPath`` definition. By @junkmd. * Add type annotations to many modules. By @junkmd. * Add constants to many modules. By @junkmd. * Improve import block styles to many modules. By @junkmd. * Add ``SupportErrorInfoTest`` to ``test_comserver``. By @junkmd. * Add ``test_errorinfo``. By @junkmd. * Improve the type safety of ``errorinfo.ReportException``. By @junkmd. * Change the method of retrieving the values of each field in ``_...MemberSpec`` from unpacking to dot access. By @junkmd. * Split ``server.connectionpoints.ConnectionPointImpl._call_sinks``. By @junkmd. * Refactor ``create_vtbl_mapping``, ``create_dispimpl`` and ``_encode_idl``. By @junkmd. * Add ``test_hresult``. By @junkmd. * Add ``Test_Vtbl`` to ``test_comobject.py``. By @junkmd. * Delint ``IUnknown_AddRef`` and ``IUnknown_Release``. By @junkmd. * Convert ``assertRaises`` usage to context manager for improved readability. By @junkmd. * Remove the unused ``PATH`` variable from ``client/_generate.py``. By @moi15moi. Release 1.4.10 -------------- * Replace ``GetModuleFileNameA`` with ``GetModuleFileNameW`` to prevent a ``TypeError``. By @junkmd. * Refactor ``server.register``. By @junkmd. * ``PythonClass`` and ``PythonPath`` are no longer registered in the registry for a frozen server. By @junkmd. * Use ``WinDLL``/``OleDLL`` instead of ``windll``/``oledll``. By @moi15moi. * In ``tools.tlbparser``, replace ``windll.oleaut32.QueryPathOfRegTypeLib`` with ``typeinfo.QueryPathOfRegTypeLib``. By @moi15moi. * Adjust ``QueryPathOfRegTypeLib`` docstring. By @moi15moi. * Reserve blank lines in the generated modules. By @junkmd. * Refactor ``tools`` subpackage. By @junkmd. * Add ``ActiveObjTest`` to ``test_comserver``. By @junkmd. * Replace deprecated install command in CI pipelines. By @moi15moi. * Remove unused parameters in ``_shutdown``. By @moi15moi. * Delete ``preview.bat``. By @moi15moi. * Remove unnecessary ``ruff`` lint rules from ``pyproject.toml``. By @moi15moi. * Refactor some code from ``client/__init__.py`` into modules. By @junkmd. * Remove workarounds for Windows CE in ``find_memleak``. By @junkmd. * Format import blocks and add ``extend-select = ["I"]`` to ``[tool.ruff.lint]``. By @junkmd. Release 1.4.9 -------------- * Separate patch processing within ``_com_interface_meta`` into a module. By @junkmd. * Replace ``Literal`` and ``Protocol`` with runtime-referable symbols. By @junkmd. * Refactor from ``%`` string formatting to f-strings in many modules. By @newwingbird. * Refactor from ``%`` string formatting to f-strings in ``_post_coinit.unknwn``. By @junkmd. * Remove the script entry point in ``comtypes.shelllink``. By @cosmastech. * Move the modules that define IDL stuff and ``instancemethod``. By @junkmd. * Allow the definition of the ``_midlSAFEARRAY(HRESULT)`` type. By @davidschranz. * Split ``server/w_getopt.py`` into production code and test code. By @junkmd. * Add docstrings to the module defining the ``GUID`` symbol. By @junkmd. * Fix broken unregistration of 64bit type libraries. By @forderud. * Replace alias definitions with ``ctypes.wintypes`` imports. By @fmtabler. * Revive ``pywin32`` related tests. By @junkmd. * Revive comserver related tests. By @junkmd. * Separate the part that creates entries from ``server.register.Registrar`` and refactor it. By @junkmd. * Add ``Test_Registrar_...``. By @junkmd. * Many typing improvements. By @junkmd. * Separate ``vtbl`` creation within ``_comobject`` into a module. By @junkmd. * Migrate the documentation from PythonHosted to ReadTheDocs. By @junkmd. Release 1.4.8 -------------- * Remove Python 3.7 and add Python 3.13 to the CI pipelines. By @junkmd. * Add constant definitions to ``shelllink``. By @junkmd. * Add more tests to ``test_stream``. By @junkmd. * Add the ``void_type`` definition to ``tlbparser``. By @junkmd. * Modernize ``tools.tlbparser.get_tlib_filename``. By @junkmd. * Extract the methods for parsing externals and dual interfaces from ``Parser.parse_typeinfo``. By @junkmd. * Fix type annotations referenced by ``tlbparser``. By @junkmd. * Modernize ``codegenerator.namespaces``. By @junkmd. * Improve static typing for ``CoGetClassObject`` and ``GetClassObject``. By @junkmd. * Refactor the ``__new__`` methods of ``_cominterface_meta`` and ``_coclass_meta``. By @junkmd. * Prevent errors caused by defining members with the same name within an enum type. By @junkmd. * Remove remaining ``__cmp__`` methods. By @newwingbird. * Remove remaining ``from __future__ import print_function`` lines. By @newwingbird. * Prevent ``itf`` to be an unbound variable in ``_cominterface_meta.__get_baseinterface_methodcount``. By @newwingbird. * Modify the metaclasses to ensure compatibility with Python 3.13 and earlier versions. By @junkmd. Release 1.4.7 -------------- * Improve ``_CArrayType`` alias import. By @junkmd. * Rename ``_byref_type`` and ``_carg_obj`` to ``_CArgObject``. By @junkmd. * Fix typos and make the wording more natural in ``README.md``. By @umarbutler. * Modernize ``BSTR`` definition. By @junkmd. * Modernize ``tagDEC`` definition. By @junkmd. * Remove methods with mangling names in ``typeinfo``. By @junkmd. * Rename ``test_istream`` to ``test_stream``. By @junkmd. * Add ``test_msvidctl``. By @junkmd. * Add ``test_storage``. By @junkmd. * Add ``test_monikers``. By @junkmd. * Add ``test_shelllink``. By @junkmd. * Add ``test_persist``. By @junkmd. * Modernize ``persist``. By @junkmd. * Add type annotations to ``shelllink``. By @junkmd. * Bump ``python_requires`` to ``>=3.8`` in ``setup.cfg``. By @junkmd. Release 1.4.6 -------------- * Add tests and method annotations for ``IRecordInfo``. By @junkmd. * Improve static typings in ``automation``. By @junkmd. * Tidy up import part in some modules. By @junkmd. * Refer to ``Any`` and ``Tuple`` from the ``hints`` stub instead of directly importing them in generated modules. By @junkmd. * Modernize ``GUID.py``. By @junkmd. * Improve ``codegenerator.modulenamer`` static typing. By @junkmd. * Avoid using keywords in ``TYPE_CHECKING`` blocks. By @junkmd. * Improve member defining parts of ``ParseInterface`` and ``ParseDispatch``. By @junkmd. * Fix Annoying SyntaxWarning. By @v01d-gh. Release 1.4.5 -------------- * Split ``__init__.py`` into some modules. By @junkmd. * Fix importing ``_DispMemberSpec`` in ``automation``. By @junkmd. * Fix importing ``_encode_idl`` in ``_comobject``. By @junkmd. * Change the name of the component that implements the interface for record parameter testing. By @geppi. * Implement ``SAFEARRAY`` pointers and ``SAFEARRAY``s as method parameters of a Dispatch Interface. By @geppi. * Change the default value of the ``extra`` parameter in the ``create`` method of ``tagSAFEARRAY`` subtypes. By @geppi. * Implement static import for ``ISequentialStream``. By @jonschz. * Modernize ``test_wmi``. By @junkmd. * Add static typing for ``_midlSAFEARRAY``. By @junkmd. Release 1.4.4 -------------- * Stop mentioning the last version supporting Windows CE in ``README.md``. By @forderud. * Declare the minimum Python version as 3.7. By @jaraco. * Move package configuration to declarative config. By @jaraco. Release 1.4.3 -------------- * Refactor ``test_findgendir``. By @junkmd. * Update ``test_GUID``. By @junkmd. * Add a feature to ``typeannotator`` that interprets the return value. By @junkmd. * Update type annotations for ``_IUnknown_Base`` and ``IUnknown``. By @junkmd. * Add ``groupby_impltypeflags``. By @junkmd. * Add static typing for when a ``CoClass`` is assigned as the return value type. By @junkmd. * Improve ``EnumerationNamespaces`` and ``CodeGenerator.enum_aliases``. By @junkmd. * Modernize constructor arguments and attributes of each stuff in ``typedesc``. By @junkmd. * Split ``codegenerator`` into some modules in the sub-package directory. By @junkmd. * Implement record pointers as method parameters of a Dispatch Interface. By @geppi. * Add ``npsupport`` to CI pipeline matrix. By @junkmd. * Add "Frequently Asked Questions" to ``README.md``. By @junkmd. Release 1.4.2 -------------- * Improve the stability of module generation by ``GetModule``. By @junkmd. * Define ``c_int`` aliases earlier than others in wrapper modules. By @junkmd. * Remove trailing newlines generated by ``codegenerator`` and ``typeannotator``. By @junkmd. * Determine whether a interface is one of the known symbols not only by its name but also by using its iid. By @junkmd. * Add ``Incomplete`` and ``Hresult`` to ``hints.pyi``. By @junkmd. Release 1.4.1 -------------- * Fix ``TypeError`` when defining enumeration types. By @junkmd. Release 1.4.0 -------------- * Add enumeration definitions in generated friendly modules. By @junkmd. * Add descriptions to ``index.rst`` about the enumeration types. By @junkmd. * Add GitHub Actions auto-test workflow. By @junkmd. Release 1.3.1 -------------- * Add type annotations to dynamically generated modules. By @junkmd. * Bring back Excel early-bind test. By @junkmd. * update ``README.md``. By @junkmd. Release 1.3.0 -------------- * Improve error message on non Windows environments. By @CristiFati. * Adjust styles of codebase. By @junkmd. * Apply ``black==22.12.0`` formatter. By @junkmd. * Modernize ``client.dynamic``. By @junkmd. * Add tests for ``client.dynamic``. By @junkmd. * Fix ``test_client``. By @junkmd. * Fix ``test_getactiveobj``. By @junkmd. * Make explicit the symbols that imports from the wrapper module into the friendly module. By @junkmd. * Modernize type annotations in statically defined modules. By @junkmd. * Fix several type annotations in statically defined modules. By @jonschz and @junkmd. * Remove ``sys.version_info`` bridges from production codebase. By @junkmd. * Remove ``for_stub=True`` conditional branch from the ``tools.codegenerator.ImportedNamespaces.getvalue``. By @junkmd. * Fix ``codegenerator`` as generating ``__next__()`` instead of ``next()`` in ``IEnum...``. By @jonschz. * Add unit test for generated ``IEnum...`` interfaces. By @jonschz. * Remove ``'Programming Language :: Python :: 2.7'`` from ``setup.py``. By @junkmd. * Change the base class of ``_ComMemberSpec`` and ``_DispMemberSpec`` to ``typing.NamedTuple``. By @junkmd. * Delint and remove wildcard-import from ``typeinfo``. By @junkmd. * Split ``DISPPARAMS`` instantiation in ``IDispatch.Invoke`` method. By @junkmd. * Move ``clear_comtypes_cache`` to be a callable ``comtypes.clear_cache`` module. By @bennyrowland. * Wrapper modules are now imported into friendly modules using an abstracted name, ``__wrapper_module__``. By @junkmd. * Fix old index bug in ``call_with_inout`` within ``_fix_inout_args``. By @jonschz. * Fix ``CONTRIBUTING.md``. By @junkmd. * Update ``README.md``. By @junkmd. Release 1.2.1 -------------- * Replace ``distutils`` with ``setuptools``. By @junkmd. * Add Python 3.12 testing into CI pipeline. By @junkmd. * Set long description type to "markdown" to fix PyPI description rendering. By @junkmd. * Add ``hints.pyi`` to ``package_data`` in ``setup.py`` which copies ``hints.pyi`` to correct install location. By @junkmd. * Remove Python >=3.3, <=3.6 from CI pipeline. By @vasily-v-ryabov. Release 1.2.0 -------------- * Remove all automatic imports of ``numpy``, and make ``numpy`` interop opt-in. By @bennyrowland. * Move and redefine generating module functions for fixing cross imports. By @junkmd. * Refactor creating ``__all__`` part in ``codegenerator.Generator.generate_code``. By @junkmd. * Quit calling ``GetModule`` from ``tools.codegenerator``. By @junkmd. * Commonize module-creating functions. By @junkmd. * Shorten the lifetime of ``io.StringIO`` used for code generation. By @junkmd. * Fix import source of ``Array`` from ``_ctypes`` to ``ctypes``. By @junkmd. * Add ``for_stub`` mode to ``ImportedNamespaces.getvalue``. By @junkmd. * Remove ``monkeypatch_COMError``. By @junkmd. * Remove ``CodeGenerator.need_GUID``. By @junkmd. * Carve out ``CodeGenerator.type_name`` method to ``TypeNamer`` class. By @junkmd. * Add ``__known_symbols__`` attributes. By @junkmd. * Remove ``CodeGenerator.type_name`` calls no longer needed and rename to ``_to_type_name``. By @junkmd. * Change ``_fix_inout_args`` to module-level top level function. By @junkmd. * Fix docstring from ``DispInterfaceHead``. By @junkmd. * ``...METHOD`` and ``...PROPERTY`` return ``_MemberSpec``s instead of ``tuple``s. By @junkmd. * Make generating ``...property`` DRY. By @junkmd. * Refactor ``_MemberSpec`` stuffs and separate modules. By @junkmd. * Carve out ``make_...Method`` and ``make_...Property`` of ``codegenerator``. By @junkmd. * Removed extra space in ``typeinfo.IRecordInfo._methods_``. By @j0ker70. * Add type annotations to many modules. By @junkmd. * Fix type annotations in many modules. By @j0ker70, @muddi900, and @junkmd. * Delint ``setup.py``. By @jaraco. * Add ``CONTRIBUTING.md``. By @junkmd. * Modernize ``README.md`` style. By @junkmd. * Add announcements of plan for renaming ``master`` branch to ``main`` and dropping Python2 to ``README.md``. By @junkmd. Release 1.1.14 -------------- * Fix ``SyntaxError`` in generated docstring. Thanks @junkmd. Release 1.1.13 -------------- * Many fixes in code generator. Thanks @junkmd. * Make tests runnable on AppVeyor CI. Many improvements in tests. Thanks @junkmd and @dmwyatt. * Update (bound_)named_property args and attributes names to be similar to builtin property. Thanks @junkmd. * Refactor function ``GetModule`` and fix type lib timestamping for incomplete generated module. Thanks @junkmd. * Fix recent numpy versions support. Thanks @mworion. * Split ``Constants`` into a separate module. Thanks @junkmd. * ``client.GetModule`` can take a one liner containing lib UUID. Thanks @junkmd. * Use ``Generator.imports`` instead of ``Generator._externals``. Thanks @junkmd. * Rename README to README.md. Thanks @junkmd and @filipporomani. * No patching or modifying ``typedesc.Obj.name`` in ``tools.codegenerator``. Thanks @junkmd. * Load enumerations into ``client.Constants``. Thanks @junkmd. Release 1.1.12 -------------- * Fix ``_pack_`` being returned as a float. Thanks @kdschlosser. * More general fix for timestamping a type library. Thanks @kdschlosser. Release 1.1.11 -------------- * Fix setuptools>=57.5.0 compatibility. Thanks @kdschlosser. * Fix timestamping for typelib. Thanks @fusentasticus. * Fix 64bit inproc server. Thanks @klusidy. * Drop Python 2.6 support (Python 2.7 is still supported). * Fix IndexError for empty safearray. Thanks @BALOGHBence. * Make numpy typecodes consistent across numpy versions. Thanks @bennyrowland. Release 1.1.10 -------------- * Fix loading module from relative path on Windows 7. Release 1.1.9 ------------- * Fix loading module from relative path. * Use comtypes release version in code generator version check. Release 1.1.8 ------------- * Fix No module named 'comtypes.gen.stdole'. Thanks @fxthomas. * Fix NumPy >= 1.16 support. Thanks @mobiusklein. * Use the embedded timestamp for cache invalidation. Thanks @vijairaj. * Allow customization of shutdown behavior (It fixes crash during exit in applications that embed Python). Thanks @lassoan. * Extend GetModule() with CLSID support. Thanks @forderud. * Fix invalid handling of WindowsError on Python 3. Thanks @leonardder. * End bdist_wininst support in setup.py. Thanks @wkschwartz. * Drop Windows CE support. Thanks @forderud. Release 1.1.7 ------------- * Fix command ``pip install comtypes --no-cache-dir --target="C:\tmp"`` (issue #158). Release 1.1.6 ------------- * Fix ``pip install comtypes`` error: "option --single-version-externally-managed not recognized" (issue #155). Release 1.1.5 ------------- * Fix using temp directory as a cache folder when it has no write permission. Thanks to @kviktor, @totaam, @morganwillcock, @kongxinchi, @Chaoste for their pull requests and patience. * Revive ``clear_comtypes_cache.py`` and add it to post-install step. * Fix hang in ``CreateObject`` for restricted user (#124). Release 1.1.4 ------------- * Fix TypeError when gen folder is unwriteable and it is a namespace package (#102). Thanks to @orf for the bug report. Thanks to @jornb for the initial proposal demonstrating a workaround. Release 1.1.3 ------------- * Fix SyntaxError caused by enums containing python keywords. Thanks to @laripk for the fix and @janbrohl for the bug report. Release 1.1.2 ------------- * Fix TypeError when interfaces return a single in-out result (#84). Thanks to FranOis for the bug report and max-egger for suggesting the fix. * Fix AttributeError when cleaning up safe arrays at shutdown (#83). Thanks to mitaa for the bug report and fix. * Fix 64-bit ULONG_PTR definition in typeinfo module (#82). Thanks to aparamon for the bug report. * Add POINTER(BSTR) to supported VARIANT types (#81). This allows the Esri ArcObjects library to be loaded. Thanks to Matt Wilkie for the patch. * Properly catch error when attempting to cache code to an unwritable directory (#78). Thanks to Robin Dunn for the patch. Release 1.1.1 ------------- * Fixed backwards-incompatible change where empty strings in VARIANTs were being converted to NULL (#68). Thanks to shgohh for the bug report. * Fixed npsupport module to fail gracefully when numpy is not present (#62). Thanks to kyleMR for the patch. * Fixed low-level property machinery in _comobject (#60). * Fixed bug where numpy would be imported when using safe arrays (#59). Thanks to Paul Moore (pfmoore) for submitting the bug and a patch. * Fixed bug in patching machinery (#57). Thanks to Paul Moore (pfmoore) for the patch. * Various documentation cleanups. Release 1.1.0 ------------- * Updated automation code to convert c_int64 and c_uint64 to their VT_I8 and VT_UI8, respectively (#49). * Update automation code to convert VT_DECIMAL VARIANT to Decimal type (#44). * Fixed an undocumented bug that would lead to improper behavior when nesting the ``safearray_as_ndarray`` context (#41). * Added a license file and merged the ChangeLog into CHANGES.txt (#35, #39). * Extended and homogenized indexing across container and named property interfaces (#32, #43). This introduces the ability to index with an empty slice, which has the same meaning as indexing with an empty tuple. * Completed migration to ``patcher`` module (#31). * Extended NumPy support so object and datetime64 arrays can be converted to VARIANT safearrays (#29). * Extended test runner so it can be run under 32- and 64-bit Python and be used in an automated testing system (#25, #28). * Modified many tests so they run under 64-bit python (#21, #22, #23). * Removed reference cycle in PumpEvents (#19). * Fixed safearray test that would fail under NumPy 1.6 (#19). * Project migrated to http://github.com/enthought/comtypes. Issue numbers refer to the new project page. Release 1.0.0 ------------- * #27: Replaced the ``partial`` module with a ``patcher`` module. This new technique patches the underlying classes explicitly. This technique avoids the problems with the metaclass magic on Python 3. * Officially dropped support for Python 2.5. * #25: Allow installation on non-Windows systems. * #31: Improved 64-bit compatibility by specifying argtypes for GetMessage. Earlier Changes --------------- 2010-04-09 Thomas Heller * comtypes.client.dynamic: Added _FlagAsMethod(*names) method to the _Dispatch class. This allows to flag these attribute names as being methods. Some objects do not correctly differentiate methods and properties, leading to problems when calling these methods. 2010-02-23 Thomas Heller * pointers and byref() objects will now be stored in a VARIANT as VT_BYREF type. This allows to call dispinterface methods with BYREF arguments. 2010-01-21 Thomas Heller * Add a __repr__ method to named_property and bound_named_property object. 2010-01-15 Thomas Heller * Bump version number to 0.6.3dev: development version. 2010-01-15 Thomas Heller * Bumped version number to 0.6.2. * CoUninitialize() returns nothing, not HRESULT. 2009-12-22 Thomas Heller * Bug fixes for event handlers implemented in Python. 2009-12-11 Thomas Heller * COM servers implemented in Python can now fire events; it did not work in some cases. * When an exception occurs in a COM event handler, a traceback is printed. 2009-11-26 Thomas Heller * Allow typelib wrappers that contain 'SAFEARRAY(VARIANT*)' parameter types to be imported. Calling these methods will fail, though. 2009-11-13 Thomas Heller * To avoid a memory leak when PyInitialize()/PyUninitialize() are called several times, return S_FALSE from inproc server's DllCanUnloadNow(). 2009-11-05 Thomas Heller * COMObject subclasses can now implement a _final_release_() method to free up resources, for example. This method is called when the COM reference count reaches zero. * Implement __hash__ method in dynamic dispatch classes. This fixes a 'python -3' warning. * comtypes\safearray.py: When numpy is not installed, creating safearrays took a very long time. This is fixed now. * comtypes\test\test_server.py: New way to test COM client and server. Work in progress. 2009-10-22 Thomas Heller * Support broken COM objects that provide IProvideClassInfo2, but not IProvideClassInfo (although the latter is derived from the former). See http://sourceforge.net/tracker/index.php?func=detail&aid=2829887&group_id=115265&atid=692942 * Fixed a regression from the 0.4 version, [out] parameters didn't accept pointers or arrays any longer. Thanks again to Michael Eddington. 2009-10-19 Thomas Heller * Fix a memory leak in Python COM servers. Thanks to Michael Eddington for the patch. 2009-10-02 Thomas Heller * comtypes\test\test_server.py: Start a better approach to test both COM object calls and COM object implementations. 2009-09-09 Thomas Heller * Fix returning SAFEARRAY of VT_RECORDs. Based on a patch from Eduardo Arias. * New module comtypes.viewobject, contains the interfaces IViewObject, IViewObject2, IViewObjectEx. IAdviseSink is faked. * Change version number to 0.6.2dev. 2009-09-04 Thomas Heller * CoTaskMemFree does not return a HRESULT. Patch from James Teh. 2009-08-19 Thomas Heller * Bumped version number to 0.6.1. 2009-08-07 Thomas Heller * When an interface was specified in the call to IClassObject.CreateInstance, return that instead of calling GetBestInterface. Patch from James Teh. 2009-08-04 Thomas Heller * Added comtypes.CoGetClassObject() low-level function, comtypes.client.GetClassObject() high-level function, and implemented a pythonic interface to IClassFactory's CreateInstance method: def CreateInstance(self, punkouter=None, interface=None, dynamic=False) * Added the 'dynamic=False' parameter to the comtypes.client.CoGetObject and comtypes.client.GetActiveObject functions. Suggested by James Teh. 2009-06-17 Thomas Heller * comtypes.automation: Support VT_I8 and VT_UI8 SAFEARRAYs. * comtypes._comobject: Restore compatibility with Python 2.3. * Add the comtypes.IServiceProvider interface. Based on a patch from Michael Curran. 2009-04-30 Thomas Heller * Change version number in repository to 0.6.0.2dev. * Replace the VARIANTEnumerator implementation class in comtypes.server.automation with a new one which should actually be usable. * A completely new way how localserver and inproc server instances are managed: A comtypes.LocalServer or comtypes.InprocServer instance is attached to the comtypes.COMObject class at runtime. These changes keep localserver running as long as COMObject instances are alive. 2009-04-29 Thomas Heller * comtypes.errorinfo.ReportException now takes an additional 'stacklevel' named argument. * Add E_OUTOFMEMORY hresult code. * Register the InprocServer32 only when running as script or py2exe dll, not when running as py2exe exe server. 2009-04-25 Thomas Heller * SAFEARRAYs can now also be created from multi-dimensional numpy arrays. 2009-04-23 Thomas Heller * Change version number in repository to 0.6.0.1dev. * SAFEARRAYs can now also be created from array.array objects, and from (one-dimensional) numpy arrays. This is a lot faster than creating them from Python lists or tuples, at least for large arrays. * ctypes instances like c_int, c_ubyte, and so on can now be assigned to VARIANT().value. This allows to force creation of VARIANTs with the corresponding typecodes V_I4, VT_UI1 and alike. * Accept typelibs that contain SAFEARRAY(char). 2009-03-17 Thomas Heller * Fixed the return type of ITypeLib::ReleaseTLibAttr, which is documented wrongly in MSDN. The return type is void, not HRESULT. Reported to cause crashes on Windows 7. 2009-01-29 Thomas Heller * Restore compatibility with Python 2.3. * comtypes\client\_code_cache.py: Add missing 'import types' in comtypes\client\_code_cache.py. 2008-12-19 Thomas Heller * Bumped version number to 0.6.0. * comtypes.client.lazybind.Dipatch: If __getitem__ fails the get the indexed default value, try NewENUM. Implement __eq__ for Python 3 compatibility. * Fix a problem with SAFEARRAYs where the contained data was released too early. * Fix property get handling for FUNC_PUREVIRTUAL functions in lazybind.py 2008-12-18 Thomas Heller * Fix memoryleak in IEnumVARIANT. 2008-12-12 Thomas Heller * Merged changes from the dyndispatch branch: * Add a comtypes.client.Constants class that provides a way to access constants in the type library for an object, even when no wrapper has been created for the type library. The contants can be accessed as attributes like this, assuming 'obj' is a COM object that exposes type information at runtime via the dispatch interface: Constants(obj).MyConstant * New comtypes.client.lazybind module. * Implement NamedProperty.__call__(). Extend NamedProperty.__getitem__() and NamedProperty.__setitem__() so that they accept a tuple, which make lazy bound objects more compatible with early bound objects. * Finished (for now) the comtypes.client.lazybind module. IEnumVARIANT instances get a _dynamic attribute which defaults to False. The values returned from next() calls are retrived by calling ._set_value(self._dynamic) on the VARIANT result. * comtypes.client.dynamic: * Started changes based on ideas from Michael Curran: better dynamic dispatch support, and a way to disable the time-consuming wrapper code generation on demand. * comtypes\client: Add a new 'dynamic=False' parameter to the CreateObject function. This parameter allows to create a dynamic dispatch object, bypassing the code generation. * comtypes\automation.py: Add a new parameter to the VARIANT._get_value(dynamic=False) method. This allows to retrieve the current value as a _Dispatch() instance if the typecode is VT_DISPATCH, bypassing the code generation on the result. The IDispatch.Invoke implementation now uses this to ensure that dynamic objects are returned when possible. * comtypes\client\dynamic.py: Implement _Dispatch.__eq__ so that we can compare instances for equality. 2008-12-12 Thomas Heller * Bumped version number to 0.5.3. * Added VARIANT support for VT_I8 and VT_UI8 typecodes. 2008-12-11 Thomas Heller * Workaround for Python bug: Python 3 cannot handle a distutils installscript in the setup script * Merged the py3-branch: Various changes for py3 compatibility. The setup script now uses distutils.command.build_py.build_py_2to3 when run with Python 3.x, and converts the sources into py3 syntax on the fly (in the build directory). 2008-11-26 Thomas Heller * Added untested code to comtypes.server: RegisterActiveObject() and RevokeActiveObject(), plus some flags. * Applied a patch from Torbjørn Tyridal. This allows to high-level implement methods in COM servers, and event handler methods that have [in] and [out] arguments in mixed order. 2008-11-05 Thomas Heller * Add the IPersistFile interface to the comtypes.persist module. Add comtypes.shelllink module which contains IShellLinkA and IShellLinkW interfaces, plus the ShellLink coclass. 2008-10-29 Thomas Heller * Handle coclass pointers as arguments in com interface methods correctly. Method calls will now accept pointers to the default interface of this coclass. * The Fire_Event() method in comtypes.server.connectionpoints now returns a list of results. 2008-10-10 Thomas Heller * Import cStringIO, which should always be available on Windows, instead of first trying cStringIO and then StringIO. * Python 2.6 compatibility: use 'types.MethodType' instead of 'new.instancemethod' to fix a -3 warning. Use 'raise Exception(details)' instead of 'raise Exception, details'. Don't use tuple unpacking in exception handlers: 'except COMError, err: (hresult, text, details) = err' instead of 'except COMError, (hresult, text, details)' * Python 2.4 compatibility: os.stat() raises OSError instead of WindowsError when a file is not found. 2008-09-19 Thomas Heller * Bump version number to 0.5.3dev. * Bump version number to 0.5.2. Released comtypes-0.5.2. * COMError nows prints the contained hresult in hex. 2008-09-18 Thomas Heller * Changed the version-checking code that the code generator creates. Reintroduced (sorry, Anthony!) the comparison of timestamps, if both the typelib and the generated module are files. 2008-09-10 Thomas Heller * In comtypes\_comobject.py, Invoke: Named arguments passed to COMObject.IDispatch_Invoke are now (hopefully!) unpacked correctly. This should fix the order of parameters passed to MS office (Word, Excel) and other (autocad?) event handlers. 2008-09-04 Thomas Heller * Removed the code that compared the timestamps of Python wrapper modules and type library files - this approach was totally broken. Generated modules are out of date if they were created by the code generator module with a different version number; the version number is now checked when a module is imported. The current mechanism also works correctly for generated modules in frozen scripts. Thanks to Anthony Tuininga. 2008-08-27 Thomas Heller * Avoid double-free of BSTR strings under certain conditions. * A NULL handler is now added to the comtypes logger; this prevents messages like 'No handlers could be found for logger "comtypes"' when an error message is logged and the logging module is not configured. https://sourceforge.net/tracker/index.php?func=detail&aid=2066024&group_id=115265&atid=692940 2008-08-20 Thomas Heller * Changed the codegenerator to generate 'c_longlong' instead of 'c_float' for CURRENCY. This is not really correct since the CURRENCY value is a fixed point integer scaled by a factor of 10000, but at least the code will not crash. Need a test case. * comtypes.server.register: Add an optional 'executable' parameter to Registrar.register(cls), can be used to override the executable image name that comtypes detects itself. Patch by Michael Robellard. 2008-08-15 Thomas Heller * comtypes.client._find_gen_dir() improved (based on a patch and helpful thoughts of Stefan Schukat): If comtypes.gen is not a directory in the filesystem, or not writeable by users, a new directory is created which will cache generated code. This could be the case if comtypes is installed in a directory that has no write permissions by the urrent user, if the comtypes package resides in a zip-archive or a zipped egg, or if comtypes is used in a py2exe'd script. '%APPDATA%\\Python\Python\comtypes_cache' is used for a normal Python script, for a py2exe frozen executables the directory will be '%TEMP%\comtypes_cache\-' where is the basename without extension of the frozen executable image, and is the major and minor Python version number, '25' for example. This makes sure that generated modules will *always* cached in the file system. 2008-08-13 Thomas Heller * comtypes\automation.py: Allow this module to be imported on Windows CE. Using safearrays on Windows CE will not work. I'm not sure if they are used much. 2008-08-08 Thomas Heller * Implement InterlockedIncrement and InterlockedDecrement for win64. 2008-08-07 Thomas Heller * Bump version number to 0.5.1 * comtypes\tools\codegenerator.py: Change the order of the interfaces in the _com_interfaces_ and _outgoing_interfaces_ list so that the default interface is the first one. This fixes the bug that GetEvents() and ShowEvents() sometimes did use the wrong event interface. 2008-08-06 Thomas Heller * The repository was moved from python.org to sourceforge.net. The svn trunk URL is now: https://comtypes.svn.sourceforge.net/svnroot/comtypes/trunk The script that extracted the repository is in admin/extract_comtypes_repo. The repository structure and the revision numbers have changed; the last revision on python.org is rev 65336, this was imported as revision rev 355. 2008-07-18 Thomas Heller * comtypes\test\find_memleak.py: Windows CE does not have GetProcessMemoryInfo; disable the find_memleak function because it cannot work. * comtypes\client\_generate.py, comtypes\typeinfo.py: Windows CE doesn't have QueryPathOfRegTypeLib - try to emulate it. Also it doesn't use tha PATH environment variable; use a hardcoded search path for type libraries. * comtypes\test\runtests.py: Define a main() function. 2008-05-29 Thomas Heller * Improved the [in, out] parameter workaround. These parameters are now optional. Removed the special codegeneration for [in, out] parameters in IEnumXXX.Next methods. Added test. 2008-05-16 Thomas Heller * Provide a workaround for a bug in ctypes. This allows methods using [in, out] parameters to correctly convert native Python values. * comtypes/tools/tlbparser.py: When GetRefTypeInfo(hreftype) fails, emit a warning and generate a fake type instead. 2008-05-07 Thomas Heller * Fixed the definition of VARIANT.empty and VARIANT.null; the values were swapped. https://sourceforge.net/tracker/?func=detail&atid=692940&aid=1959722&group_id=115265 2008-04-25 Thomas Heller * Replace logger.info() calls with logger.debug() since it is more appropriate. In comtypes.server.connectionpoints, when a event notification fails with an error indicating that the event sink is no longer present, close the connection and log a warning. The __repr__ of VARIANT changed again to make it a little bit shorter. VARIANT instances of VT_BREF are NOT unpacked when the .value attribute as accessed. The value instead can be got or set by indexing, so the api is the same as for pointer instances: print byref_var[0] byref_var[0] = value 2008-04-17 Thomas Heller * More changes merged from upstream svn 26400, add support for implementing (non-dual) dispinterfaces (work in progress). * Merge in a lot of changes from the private upstream repository 26394; mainly much better support for implementing comtypes servers. 2008-04-09 Thomas Heller * Bump version number to 0.4.3a * Released version comtypes 0.4.2. * comtypes.util: New module, containing the byref_at() and cast_field() helper functions. 2008-04-07 Thomas Heller * Fix the codegenerator to handle all kinds of IEnumXXX::Next method signatures; the second and third parameters may be [out] or [in, out]. 2008-03-07 Thomas Heller * Implemented support for SAFEARRAYs containing com interface pointers. 2008-03-04 Thomas Heller * Add comtypes.client.gen_dir to comtypes.gen.__path__ so that the codegenerator can import its generated module(s). 2008-02-08 Thomas Heller * Hacked support for 'open array' [out] parameters in COM methods. These are arrays that have both size_is() and length_is() in IDL. See the comments in comtypes\tools\codegenerator.py, search for 'OPENARRAY'. 2008-02-06 Thomas Heller * The badly named comtypes.client.wrap function was renamed into comtypes.client.GetBestInterface. For backwards compatibility the old name stays as an alias. * Replaced the comtypes.messageloop.add_filter(filter) function with comtypes-messageloop.insert_filter(index, filter). This allows to specify the order in which the filters are applied. * Added a workaround for the buggy _ctypes.COMError in Python 2.5 and 2.51. 2007-12-19 Thomas Heller * Bump version number to 0.4.2. * Special methods (__iter__ and so on) did not work on dispinterfaces, because the __map_case__ dictionary was not populated. 2007-11-23 Thomas Heller * Released version comtypes 0.4.1. * Add a PumpEvents(timeout) function to comtypes.client. This function calls the win32 CoWaitForMultipleHandles() function which will wait in a way compatible with all types of apartments; additionally this function can be interrupted with Control+C. 2007-11-21 Thomas Heller * comtypes\__init__.py: Add docstrings to special methods. Make named_property a data descriptor by providing a __set__ method (which will raise AttributeError when called). 2007-11-15 Thomas Heller * comtypes\__init__.py: Fix bound_named_property.__setitem__ so that COM properties can be set that require zero or more than one arguments. * comtypes\__init__.py: Restructure the code that extend the COM interface subclasses with __len__, __call__, __getitem__, and __iter__ methods. This is done with the comtypes.partial module, and apparently had strange behaviour when the code is run under a debugger. 2007-11-07 Thomas Heller * Changed version number to 0.4.1. * Add an post-install script that will (after confirmation) remove the comtypes\gen directory containing the generated modules. 2007-11-02 Thomas Heller * Bump version number to 0.4.0. Released version 0.4.0. * In _wrap_coclass, attach a __clsid attribute to the returned object. This allows, for example, to find outgoing interfaces when a CoClass is returned from a COM method call. 2007-10-26 Thomas Heller * Implemented property get, put, and putref with arguments in comtypes.client.dynamic. * When a COM property has both propput and propputref accessor methods, the Python property fset methods determines the type of the argument. If the argument is a COM interface pointer, or a VARIANT containing one, then propputref is called, otherwise proput is called to set the property. * Allow the creation of SAFEARRAY(UDT) types even if the UDT has no _recordinfo_. Creating instances of these types will fail however since no IRecordInfo pointer can be created. This change allows to import typelib wrappers that have UDTs without guids. 2007-10-24 Thomas Heller * When a COM property has a 'propputref' but no 'propput' accessor method, use the former in the same way as a 'propput' would work. When both 'propputref' and 'propput' are present, raise a TypeError because we cannot handle this case for now. * Fixed infinit recursion error in __getattr__ implementation. * comtypes.dynamic._Dispatch now implements a __setattr__ methods that will call to Invoke() with DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF. * Handle DISPATCH_PROPERTYPUTREF in IDispatch.Invoke implementation. * comtypes.dynamic._Dispatch objects can now be used as VARIANT value. 2007-10-22 Thomas Heller * The repr of a COM pointer instance now includes the pointer value for easier debugging. 2007-10-17 Thomas Heller * Disable the VT_UNKNOWN and VT_DISPATCH safearray codes, they do not work yet. * More multidimensional safearray tests, bug fixes. * Speed up the unpacking of 1- and 2-dimensional safearrays. * Lots of refatoring of the new SAFEARRAY code; added a docstring to the public function comtypes.safearray._midlSAFEARRAY. * For easier debugging, the repr of a VARIANT instance now contains the vartype. 2007-10-16 Thomas Heller * Changed version number to 0.3.4. * Mega-patch: Completely rewritten safearray support. SAFERARRAYs are now automatically converted to Python tuples when they are received as [out] parameters in COM methods, and sequences are accepted as SAFEARRAY [in] parameters. Multidimensional safearray support still has to be added. * VARIANTs can now also contain SAFEARRAYs. VARIANTs containing SAFEARRAYs with a typecode other than VT_VARIANT, Python array.array instances can be used. * Added a comtypes.messageloop module that contains a simple messageloop which allows to add and remove custom filter functions. * Removed the comtypes.client.PumpWaitingMessages function. * Fixed the codegenerator so that it handles unnamed method parameters. 2007-10-04 Thomas Heller * Several refactorings and a small bugfix from the upstream repository. * In the comtypes\gen\... type library wrappers, the code generator now creates a commented out template that shows an implementation for each interface it wraps. 2007-10-02 Thomas Heller * comtypes.safearray.UnpackSafeArray can now unpack SAFEARRAYs that containt UDT (user defined data types). Patch by Rimon Barr, testcase by me. 2007-09-14 Thomas Heller * Released version 0.3.3. 2007-09-12 Thomas Heller * Bump version number to 0.3.3. 2007-09-03 Thomas Heller * Add the partial module, which allows the usual class statement syntax to attach methods to already existing classes. * Use partial in comtypes.automation to attach methods to POINTER(VARIANT). 2007-08-24 Thomas Heller * Added a custom outgoing interface to TestComServer.idl. Implemented IConnectionPointContainer in TestComServer.py. * comtypes.server.automation: Fix the IProvideClassInfo2.GetGUID implementation. * comtypes.client: Fix ShowEvents(): COM methods must return a HRESULT value, not None. Fix several NameErrors in the PumpWaitingMessages function. 2007-08-14 Thomas Heller * comtypes\tools\codegenerator.py: Generate the needed imports when COM defaultvalues are used in parameter lists. 2007-08-10 Thomas Heller * Add comtypes.client.PumpWaitingMessages() helper funtion. May be used to dispatch COM events in single threaded appartments. 2007-08-09 Thomas Heller * Added the IRecordInfo interface to comtypes.typeinfo. * If UDTs (structures or unions) in a typelib have a GUID defined, add a _recordinfo_ attribute to the generated code. This allows to call GetRecordInfoFromGuids(*_recordinfo_) to get an IRecordInfo pointer. * Released comtypes-0.3.2 2007-08-08 Thomas Heller * Add better support for dynamic dispatch, comtypes.CoUninitialize function. Patch from Belyaev Dmitry. 2007-03-23 Thomas Heller * Fixed: TextWrap did destroy the generated code when very long symbol names used were in the type library. * The IEnumVARIANT.Next(celt) method can now be called with celt != 1. It will return a list of items then; this allows to get more objects at a time. 2007-03-22 Thomas Heller * In comtypes.hresult, add the hex HRESULT values in comments for reference. * In comtypes.errorinfo.ReportError, use the supplied hresult value. * Improved _NewEnum client-side handling. * When a relative pathname to a type library is passed to comtypes.client.GetModule(), the pathname is now interpreted relative to the __file__ of the caller if this pathname actually exists in the filesystem. * Fixed several memory leaks and other problems in the BSTR implementation. The previous change that requires ctypes version 1.0.2 was backed out again because it was the wrong approach. 2007-01-25 Thomas Heller NOTE: This comment is no longer true, see above. * Removed unneeded methods from comtypes.BSTR. The resource management is handled by ctypes; this requires ctypes version 1.0.2 to correctly release BSTR resources. 2007-01-19 Thomas Heller * The comtypes.test package is now self contained, it does no longer depend on ctypes.test which may not be available. 2007-01-16 Thomas Heller * comtypes.tools.tlbparser: Sort interface methods by VTable order (there are typeinfos that list the methods in a different order). 2007-01-11 Thomas Heller * comtypes codegenerator: Do not hardcode pointer and VARIANT size and alignment. This fixes code generation issues on 64-bit Windows. * comtypes.automation: Fix size of VARIANT definition for 64-bit Windows. 2007-01-10 Thomas Heller * (Re-)Added comtypes.__version__ again, and set it to "0.3.2". * Removed assert statements about sizeof() and alingment() of generated Structure subclasses for portability to 64-bit Windows. * Iterating over COM collections retrived the _NewEnum property twice. * Cleaned up the codegeneration. Generated modules now have a 'typelib_path' variable that points to the type library used to generate them, 'CoClass' subclasses have '_typelib_path_' which is used for registration. 2007-01-02 Thomas Heller * comtypes\client\_generate.py: Make sure that generated modules have a __file__ attribute, even if gen_dir is None. The filename part of the __file__ attribute is '' in this case. 2006-12-20 Thomas Heller * comtypes.client.GetModule now recreates the Python module automatically if the type library file timestamp is newer than the module. The actual code for GetModule now lives in a separate module comtypes.client._generate, but the GetModule symbol is still exposed from comtypes.client. * COM method implementations are now found doing case insensitive lookup if the interfaces "_case_insensitivity_" attribute is True. * Some memory leaks with BSTR have been fixed. 2006-12-13 Thomas Heller * Fix the case insensitivity for COM interfaces (client-side only, so far): If the Python interface class has a "_case_insensitive_" attribute which is True, access of methods and properties is case insensitive. By default, this attribute is set to True in interfaces generated from type libraries, because type libraries generally don't preserve the casing of identifiers from IDL interface definitions. 2006-12-06 Thomas Heller * Fix comtypes.test.test_typeinfo to work when either IE6 or IE7 is installed. * comtypes.hresult: Add MAKE_HRESULT and HRESULT_FROM_WIN32 functions which return HRESULT values. * Receive events from the event interface plus all the super interfaces. * When a NULL IDispatch pointer is received as an [out] parameter, return None instead of the NULL pointer. * Changed the way COM is shut down. No longer a need to call the possibly expensive (or dangerous?) _is_com_initialized. 2006-11-15 Thomas Heller * comtypes.client._events.GetEvents: Catch the exception when IProvideClassInfo::GetGUID fails, and try the next strategy for finding the outgoing interface. * comtypes now has a __version__ attribute. This is set to "0.3.1". Added test command to the setup script. * New function comtypes.client.ShowEvents(source, interface=None). This function is useful for debugging; it connects the source object to a special event receiver that will first print out all the event names, and later print out the events as they occur. 2006-08-04 Thomas Heller * Fixed quite some tests to work or be skipped on Windows CE. * comtypes\typesinfo.py: Added ICreateTypeLib2 interface, and changed the CreateTypeLib function to return a pointer to that interface. * Added a COM server for testing to the comtypes.test package, plus tests for it. There are still several memory leaks in comtypes, as the tests show. 2006-08-03 Thomas Heller * comtypes\server\register.py: For localserver, the wrong script was registered when the class was not in a toplevel module. 2006-08-02 Thomas Heller * Version number changed to 0.3.0, added 'comtypes.server' package to the setup script. * Merged in a LOT of changes from the upstream version. For details see the svn commit messages. The most prominent changes are: - The strings returned by ITypeInfo::GetDocumentation() do not contain NUL characters any more (some buggy typelibs contain them) - comtypes.client.GetEvents returns a 'connection object', which will UnAdvise the connection when deleted. In other words, you must keep the return value of the GetEvents call as long as you want to reveive events. - Pointer to COM interface pointer instances __setitem__ method manages the COM refcount correctly. - Changes in the COM shutdown code: maybe the win32com way of never calling CoUninitialize() is the best compromise ;-), but I have not yet given up. 2006-07-11 Thomas Heller * Imported comtypes 0.2.1 into the python.org svn repository. 2006-04-25 Thomas Heller * Released version 0.2.1 (svn revision 8). 2006-03-07 Thomas Heller * Imported comtypes from the ctypes CVS repository into the comtypes SVN repository. 2006-03-03 Thomas Heller * (Repository): Move the code generator modules into the comtypes.tools package. Should be refactored later - most important is now that it works again. 2006-02-11 Thomas Heller * Merged in lots of changes from the upstream version. Started localserver support. 2005-10-20 Thomas Heller * comtypes\__init__.py: Add logging for easier debugging. Add COINIT_... flags. Use the value of sys.coinit_flags (when defined) in the call to CoInitializeEx, this allows to use multithreaded appartments. Clean up the lifetime management of implemented COM objects. Make COM attribute access case insensitive (has a large impact on the performance, unfortunately). Move the COMObject definition in a separate module comtypes\_comobject.py. * comtypes\tools\codegenerator.py: Don't generate dispid() for non-dispatch based interfaces. * comtypes\client\__init__.py: Add logging for easier debugging. * comtypes\persist.py: Remove dispid() from non-dispatch based interfaces. Correct the Read method. Hack around the POINTER(c_wchar) <-> c_wchar_p problem. 2005-10-11 Thomas Heller * comtypes\client\__init__.py: Renamed CreateModule() into GetModule(). Removed the 'modulename' parameter from all the function calls - the typelib wrapper alias name is now taken from the typelib library name. Suggestions from Bruce Dodson. 2005-09-29 Thomas Heller * comtypes\GUID.py: Rename the GUID.progid() classmethod into GUID.as_progid(). 2005-09-02 Thomas Heller * comtypes\client\__init__.py: Can now receive events from custom, non-dispatch interfaces.