Hi,

I'm working on a port of a Delphi component to Lazarus. The component wraps a dll for Network Communication based on ASPLs Vortex Library but implementing a full set of "easy to use" mechanisms for "daily work problems".

The dll itself is written in C++ with a C like interface. It is multithreaded and uses callbacks for a lot of purposes.
The callback function/procedure is defined like

//#---------------------------------------------------------------------
//                     CALLBACK PROCEDURES
//#---------------------------------------------------------------------
procedure ExecuteCommandClb(tmlhandle : TML_COMMAND_HANDLE; pCBData : Pointer); cdecl;
begin
 //...
end;

No matter what I do inside this procedure if I reach the end the assembler window is popping up in the debugger.
The Parameters seem to be correct.

pCBData is a Pointer to an object stored with the pointer to the callback. The procedure is used as a proxy to call
the real worker method of the object.

tmlhandle is also a Pointer, but to an object that is implemented in the dll.

The callback procedure is set like tml_Profile_Register_Cmd(FTMLCoreHandle, PCHAR(profile), cmd.CommandId, @ExecuteCommandClb, Pointer(cmd));

This command stores the inside the dlls for callbacks.

I've set the user flag -dUseCThreads in the package and it is inherited to my project.

No matter what I do inside the ExecuteCommandClb my application will crash after some calls. The Parameters seem to be correct
because for some calls they will be used correctly.

Alle this code and the dlls are tested and work stable with Delphi. That's why I hope somebody can tell me
if it is a Lazarus/FPC problem and how to solve it.

Thanks in advance
Connor

My Versions:

Lazarus IDE v0.9.28.2 Beta
MS Windows XP Prof DE sp3
FPC Version 2.2.4





--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to