Ask a question about calling the DLL compiled under VC ??? Strange. Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiBase/html/delphi_20061220075845111.html
Interface Function Definition:
Extern "C" dllexport int pcfilecopytoother (char disk,
Lpcstr pcfilename,
Lpcstr otherfilename,
Bool isdispprogress,
Lpcstr message)
I introduced the following in Delphi:
Function pcfilecopytoother (Disk: byte; pcfilename: pchar; otherfilename: pchar;
Isdispprogress: Boolean; mess: pchar): integer; stdcall;
Function pcfilecopytodev; External f3200_dll name 'pcfilecopytoother ';
I called it like this:
Pcfilecopytoother(0, pchar('1.txt'character, pchar('2.txt '), true, pchar (' Please wait ...'));
When running, there are few errors in the XP system, but when running on the 2003 Server System, there is a "memory read error "; when I change pchar to objective string, although there is no error, the parameter value may be incorrect and the expected value will not be obtained for each call.
It should be pchar for the lpcstr.
Stdcall-> cdecl in Delphi
Upstairs, I still can't do it. Is XP different from 2003 server?
There is no error when using struct string, but how can we pass the parameter?
Debug ~~
What does upstairs mean?
Is relative to release
Nobody knows?
It seems that the distribution cannot go down.
the possible cause is that if you use a constant to change the parameter value in the function, an error will occur.
the solution is to use array [0 .. xxx] of char replace pchar
or use pchar, but first apply for memory, then assign values, and then call the function