接口函数定义:
extern "C" DllExport int PCFileCopyToOther(char Disk, 
LPCSTR PCFileName, 
LPCSTR OtherFileName,
BOOL IsDispProgress,
LPCSTR Message)
我在delphi引入如下:
  function PCFileCopyToOther(Disk:Byte;PCFileName:PChar;OtherFileName:PChar;
    IsDispProgress:Boolean;mess:PChar):Integer;stdcall;
function PCFileCopyToDev;external f3200_dll name 'PCFileCopyToOther';
调用时我是这么调用的:
PCFileCopyToOther(0,PChar('1.txt'),PChar('2.txt'),True,PChar('请稍后...'));
当运行时在XP系统下就很少出错误,但到了2003 server系统下运行时就出现“内存不能read的错误”;当我将PChar改成shortstring时虽然不出错了,但是传参数时的值可能就不对了,每次调用都得不到预期的值。
LPCSTR应该对应是PChar吧