Home > Back-end >  DLL call
DLL call

Time:09-21

Masters, you have such a problem
A dynamic library written in Delph7
The Function GetARetStr (Src: Pchar) : Pchar; Stdcall;
In the D7 and cut with normal D2007
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
But in D10 call not normal pass parameters, parameter only one character to the DLL
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Var
AStr: string;
The begin
AStr:='[XXXXX]="TEST"'
SRet:=GetARetStr (Pchar (AStr));
end;
-- -- -- -- -- -- -- -- -- -- -- -- --
Run in the D10
Write the price in DLL export parameters found that only a [
-- -- -- -- -- -- -- -- --
Delphi7 or Delphi2007
To write the price in the DLL export parameter values normal: [XXXXX]="TEST"
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Help, this is how to return a responsibility?

CodePudding user response:

Transfer characters not universal, in D '7 and Delphi007, in order to can use D10, suggestion:
1, want to use widestring, replacing AnsiString, corresponding character also want to use WideChar character, instead of AnsiChar characters,
2, writing the Dll, you cannot use assembly statement, because 64 - bit and 32-bit, not the same,
  • Related