[python-win32] Using native COM interfaces

Mark Hammond MarkH@ActiveState.com
Thu, 13 Dec 2001 12:34:16 +1100


> Are you referring to using makepy on a type library? I thought
> that does early binding by determining types of arguments and return
> values but still requires IDispatch or some other interface natively
> supported by the PythonCOM DLL. Can you actually generate support
> for any native interface using makepy?

makepy now generates code used by a runtime vtable manager.  Check out
win32com\servers\test_pycomtest.py - it implements interfaces without using
dynamic vtables built from the makepy process.

> Re using makwgw/SWIG, is there any documentation? Or just a brief
> step-by-step procedure on how to go about it?

Sorry - no :(  You really have to look at one of the others.

mapi is probably your best bet.  mapilib.i sets up all the type conversion
code.  It describes how C++ objects are mapped to and from Python objects.

The other .i files then have the basic declarations for the methods being
exposed.  You can build both modules (eg, mapi.i) and COM objects (the rest
of the .i files) using this technique.

Mark.