[python-win32] SMIEngine(COM)

takeshi ikeya takeshi.ikeya at gmail.com
Thu Apr 12 00:37:18 CEST 2012

Thank you Tim. Yes.
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 their answer is

"I know little about Python.
Most of the information I have seen indicates using ctypes.
http://python.net/crew/theller/ctypes/tutorial.html "

And they asked

"Why not use  C++ ?"

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' ?

I'd like to go all in Python.


2012/4/12 Tim Roberts <timr at probo.com>

> takeshi ikeya wrote:
> > Thank you Tom.
> > I tried 'EnsureDispatch()' following your advice.
> > ...
> > pywintypes.com_error: (-2147467262, 'Inteface is not supported', None,
> > None)
> >
> > Same error occured on 'Shell.Autoplay'. And so on my 'SMIEngine.SMIhost'.
> Not every COM object was intended to be used by the "general public".
> There is no public definition that corresponds to the class ID for
> Shell.Autoplay.
> > Then I went tolaunch  'makepy.py'
> > I was asked to 'Select library'
> > But what is this 'library' mean ?
> > Nothin like 'Shell.autoplay' or 'SMIEngine'.
> >
> > Sorry I'm not familiar with COM.
> Well, that's a problem, if you plan to use COM objects.  It is
> worthwhile to do a little reading about COM basics.
> In order to use a COM object, somehow your application has to learn what
> functions that object provides, and what parameters each function
> expects.  You can't just make that up.  That can be done in three basic
> ways.  (1) If the object was designed only to be used from C++, you
> might have a C++ header file that describes the object.  (2) If the
> object was designed for "late binding", it will support the IDispatch
> interface.  (3) If the object was designed for "early binding", there
> will be a "type library" that includes all of the definitions.
> A type library contains a collection of COM class definitions and
> interface definitions in a partly compiled form.  That's what makepy.py
> wants.  When you installed the SMI product, it registered its objects.
> If it also registered its type library, you can use that to build the
> Python interface.  Note that the name of a type library often includes
> the manufacturer, so look for "Animatics SMIEngine".
> Animatics says on their web site that the SMIEngine interface works with
> Python.  Have you considered contacting them for support?
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20120412/456909f2/attachment-0001.html>

More information about the python-win32 mailing list