#16 Comtypes Crashes on Win 7


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.


  • Stefan Schukat

    Stefan Schukat - 2009-09-09

    Patched init.py

  • Thomas Heller

    Thomas Heller - 2010-01-15

    Should be fixed with comtypes 0.6.2 now (although I couldn't reproduce the crashes myself).

  • Thomas Heller

    Thomas Heller - 2010-01-15
    • status: open --> closed-fixed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks