[python-win32] Python-win32 Digest, Vol 33, Issue 7

Mark Hammond mhammond at skippinet.com.au
Wed Dec 7 04:00:28 CET 2005


> >>Certainly COM would work.  In this case your VB EXE would use
CreateObject
> >>to create a Python implemented object.

> As what type of Python Object?

> I have the VB6 ide open, and the references Browser as well,
> there is no generic Python object to include into a VB project.

> Which means one would have to create a Python COM server
> and Type library first, before being able to reference it
> from the VB IDE.

Actually, you don't need to create a typelib.  Just register the PythonCOM
server, and have VB use CreateObject with the ProgID.  All vars will need to
be declared as "object", and you wont get auto-complete type features, but
it will work.  VB supports late-binding.


> Even though I have Python Programming in Win32, I'm not sure what
> needs to be done to make a minimal Python COM server that can be
> called from VB.

Pages 221 and 222 have an example using VBA (ie, the VB embedded in MSOffice
apps)

> Also, creating a type library requires using Visual C- which isn't a
> problem, it's the language of the IDL required to create the TLB that
> I don't udnerstand.

You should be able to avoid TLBs - certainly to get started...

Mark



More information about the Python-win32 mailing list