[python-win32] SMIEngine(COM)

Tim Roberts timr at probo.com
Thu Apr 12 19:44:44 CEST 2012

takeshi ikeya wrote:
> I'm not familiar with COM, but Animatics'manual about SMIengine
> explains every objects and their interfaces.
> So I think, if I can get an instance of them, I can try and go ahead..
> I also contacted with Animatics engineer through their agent.
> ...
> And they asked
> "Why not use  C++ ?"

That's a very poor excuse for an answer on their part, since their web
site SPECIFICALLY says this:

    SMIEngine is based on the Windows Component Object Model (COM) and
    works with:

      * Microsoft C++
      * Borland C++
      * Microsoft Visual Basic (VB)
      * VBA (Visual Basic for Applications)
      * MS.Net environment
      * Borland Delphi
      * Pascal
      * Python
      * LabView (when installed as an Active-X component)

> They adviced using 'ctypes', but I think 'ctypes' is for ordinary DLL.
> The 'ctypes' can't handle COM, and can't create an instance.
> Or, their advice is right ?
> I should use 'ctypes' ?

You are correct, they are wrong.  ctypes is for normal DLLs.  There is a
"comtypes" module that provides a ctypes-like interface for COM objects,
but that should not be necessary.  Their web site advertises Python
support.  They ought to be able to tell you how to do it.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

More information about the python-win32 mailing list