IDispatch objects, problems with ActivePython

Lasse Vågsæther Karlsen lasse at cintra.no
Tue Apr 10 17:01:42 EDT 2001


First a bit of background. I'm creating a Borland Delphi class for
compiling and running ActiveScript-compatible script code from inside
a Delphi program. So far this has worked great.

What I'm trying to do is create a Delphi class, that supports the
IDispatch (automation) interface, create a Python function that
accepts a parameter, then call that Python function from inside my
Delphi program, passing an instance of my Delphi class down as the
parameter.

Then, inside the Python function, I call methods on my Delphi class
through the IDispatch interface.

It works for reading properties (attributes in Pythonspeak), writing
properties and calling methods that takes no parameters. However,
methods with parameters generates ole errors (0x80020101
specifically).

If I simply switch script language to VBScript it works flawlessly,
but in Python it crashes.

Are there any hints as to what I might be doing wrong? Code is
available upon request but I didn't want to post any binaries to this
group.

The Delphi component will be made freely available on the web as soon
as I have ironed out all the bugs (like this one) so please help me
help other Delphi programmers start using Python.

Lasse



More information about the Python-list mailing list