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-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.