迟
迟雨
Unregistered / Unconfirmed
GUEST, unregistred user!
C编写的DLL 中的函数定义extern "C" long __declspec(dllexport) Encode(PCHAR pSourceData,ULONG sourceLen , PCHAR pTagData, PULONG tagLen );在delphi中这么定义 function Encode(pSourceDataChar;sourceLen:LongWord;pTagDataChar;tagLenLongWord):Integer;cdecl; external 'Encode.DLL' ;在delphi中使用procedure TForm1.Button2Click(Sender: TObject);var encode : array [0..127] of Char; pencode : PChar; i : LongWord;begin pencode := PChar(@encode) ; i := 128; Encode(PChar('aaa'),3,pencode,@i); Edit2.Text := encode;end;运行的时候报内存错误