Private Declare Function DD29_SendFile Lib "pdd29dll.dll" (ByVal pFile As String) As Integer
Private Declare Function DD29_SendText Lib "pdd29dll.dll" (ByVal pTxt As String) As Integer
Private Declare Function DD29_ComList Lib "pdd29dll.dll" () As String 转换为DELPHI的会出错.function Dd29_SendFile(const pFile :string):integer;stdcall;external 'pDD29dll.dll';
function Dd29_SendText(Const speed:integer;const Ptxt :string):integer;stdcall;external 'pDD29dll.dll';

解决方案 »

  1.   

    VB中的string转成DELPHI,最好是WideString.
      

  2.   

    1. VB中的Integer是16位的, 对应Delphi中的SmallInt
    2. VB中的String对应Delphi中的PCharfunction DD29_SendFile(pFile: PChar): SmallInt;  stdcall;  external 'pDD29dll.dll';
    function DD29_SendText(pTxt: PChar): SmallInt;  stdcall;  external 'pDD29dll.dll';
    function DD29_ComList(): PChar;  stdcall;  external 'pDD29dll.dll';