I use a DLL in Delphi. With Delphi 2005 everything works. With Delphi 10.3 I do not get any results in “rc_getback” from a function call. The integration of the DLL with LoadLibrary works. I also get reactions with simple calls. Only the call “tcs_buch_xwork” below does not return any results.<\/p>\n
This ist the function in the DLL<\/p>\n
tcs_buch_xwork : function (wert: pointer; plz: pointer; pzart: integer; dummy: integer; rc_getback: pointer; ref:pointer) : smallint;stdcall;<\/p>\n
I get the address for the call<\/p>\n
@tcs_buch_xwork<\/span> := GetProcAddress(NameHandle, ‘tcs_buch_xwork’);<\/p>\n This is how I use the function: DLLFehler means DLLerror<\/p>\n if @tcs_buch_xwork<\/span> <> nil then<\/p>\n DLLFehler := tcs_buch_xwork (ps, pplz, cc, dummy, @rc_getback<\/span>, pNameFehler);<\/p>","upvoteCount":1,"answerCount":2,"datePublished":"2021-06-03T08:29:28.000Z","author":{"@type":"Person","name":"spiceuser-z1fut","url":"https://community.spiceworks.com/u/spiceuser-z1fut"},"suggestedAnswer":[{"@type":"Answer","text":" I use a DLL in Delphi. With Delphi 2005 everything works. With Delphi 10.3 I do not get any results in “rc_getback” from a function call. The integration of the DLL with LoadLibrary works. I also get reactions with simple calls. Only the call “tcs_buch_xwork” below does not return any results.<\/p>\n This ist the function in the DLL<\/p>\n tcs_buch_xwork : function (wert: pointer; plz: pointer; pzart: integer; dummy: integer; rc_getback: pointer; ref:pointer) : smallint;stdcall;<\/p>\n I get the address for the call<\/p>\n @tcs_buch_xwork<\/span> := GetProcAddress(NameHandle, ‘tcs_buch_xwork’);<\/p>\n This is how I use the function: DLLFehler means DLLerror<\/p>\n if @tcs_buch_xwork<\/span> <> nil then<\/p>\n DLLFehler := tcs_buch_xwork (ps, pplz, cc, dummy, @rc_getback<\/span>, pNameFehler);<\/p>","upvoteCount":1,"datePublished":"2021-06-03T08:29:28.000Z","url":"https://community.spiceworks.com/t/calling-a-function-from-delphi-to-a-c-dll/801667/1","author":{"@type":"Person","name":"spiceuser-z1fut","url":"https://community.spiceworks.com/u/spiceuser-z1fut"}},{"@type":"Answer","text":" I’m not going to be any help because i have no dll experience, but it’s nice to see a Delphi person<\/strong> around. Are you using smallint in other calls? Not sure why, but that is sticking out to me.<\/p>","upvoteCount":0,"datePublished":"2021-06-03T10:52:14.000Z","url":"https://community.spiceworks.com/t/calling-a-function-from-delphi-to-a-c-dll/801667/2","author":{"@type":"Person","name":"damontheis","url":"https://community.spiceworks.com/u/damontheis"}}]}}