During import of comtypes inside our software system under Windows 7 the comtypes reports an exception, where no exception should occur. This happens due to the fact, that the method CoInitialize is defined as an Ole32 method which checks an HRESULT return value, but in real has a void return definition. In our application under Windows 7 there is a dword with the failure bit set on the stack which comtypes interprets as a windows error. To solve this the correct definition of all ole32 functions with void return shall be used. A fix suggestion for __init__.py is attached. But a better solution would be a general fix in ctypes.OleDLL.
Log in to post a comment.