I have an application made in delphi that calls a DLL (dinamically loaded) that was also made in delphi.
But now, I rewrote that library in Lazarus and when it's code is called I get Access Violations in my application. By debuging the application I saw that the exported function is being correctly loaded by delphi's app. For example:
...
self.lib := LoadLibrary(PChar(DLL));
if self.lib>0 then
@myFunc := GetProcAddress(lib,'func');
...
myFunc gets the address of that procedure in the DLL file.
Another think is that myFunc receives a record it's parameter, this record have only primitive types, cardinals, pchars, and no strings.
If in the exported function (lazarus) I don't use that record, the code executes with no errors, but if I use it I got stack overflow or access violation.
The procedure's are built with cdecl calling convention but I have already tested with stdcall and the result is the same.
Thanks for any help