Callback Python procedure from Delphi DLL

durumdara at gmail.com durumdara at gmail.com
Mon Jul 28 10:27:43 CEST 2008


Hi!

I have a component, and a tool in Delphi.
I wanna call it from Python.

I can implement all things I need into a Delphi generated DLL.
It is ok, I can use this DLL from Python, but the DLL procedure needs a
callback procedure to return the partially output, and needs a python 
passed variable to check terminate/abort signal.

For example:
procedure ProcessFiles(InputFiles : string; CallBackProc:
????????????????????????); export;
begin
    ....
    CallBackProc(ProcessedFiles, Percentage, NeedToAbort);
    if NeedToAbort then Exit;	
    ....
end;


def CallBackProc(ProcessedFiles, Percentage, NeedToAbort):
    ...

But I don't know, how to call back this procedure, and how to pass
variables.

The other way is a ActiveX.
This time I don't load the DLL, I only construct the Delphi based Com
Object, and I start the process.

But in this way I also don't know how to implement the callback, because
the main code uses callback events, and I need to use too...

Thanks for every usable help!
  dd





More information about the Python-list mailing list