Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Python COM and Delphi callback

Thread Tools

Python COM and Delphi callback

Larry Bates
Posts: n/a
I have a Python COM object working. I want to pass to it
a Delphi callback function (showing progress) that I can
call periodically. I've Googled until I'm cross-eyed and
I'm getting nowhere. Anybody out there that could give
me a push in the right direction.

I tried passing pointer to my callback function using
@ operator in Delph, but when I compile Delphi complains.

Here is a snip of my Delphi code:

function Callback(total: integer; position: integer): boolean; stdcall;
WriteLn('In Callback, total=' + IntToStr(total) +
' position=' + IntToStr(position));
result := True;

.. In program
// Set callback function in wsAPI to be called for each block
// that is uploaded. oC contains instance of COM object and
// works perfectly. oC has a method called WSset_callback that
// expects a callback function as an argument. I have the
// callback working perfectly in pure-Python code.

When I compile I get:

[Pascal Error] wsAPICOM.dpr(151) E2281 Type not allowed in Variant
Dispatch call.

Thanks in advance for any assistance.

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Callback Python procedure from Delphi DLL Python 1 07-28-2008 08:53 AM
Python and Delphi Kristofer Carlson Python 1 12-24-2004 01:43 PM
Delphi/Kylix and Python John Tiedeman Python 1 12-05-2004 06:04 AM
Delphi Parser implemented in Python Dang Python 4 10-15-2003 05:45 PM
Any Software can Python <-> Delphi ? PythonMan Python 3 07-29-2003 02:58 PM