2017-02-11 76 views
2

我需要在Delphi中調用外部DLL中的函數,該函數定義了調用的字節,我應該如何調用它們,在Delphi中聲明它們時,它顯示它預期的語法錯誤;而不是得到@調用函數@

function [email protected](a1: INT64; a2: Pointer; a3: INT64; a4: Pointer; 
a5: INT64; a6: Pointer; a7: Pointer; a8: INT64): INT64 cdecl stdcall;external 'imp.dll'; 

function [email protected](a1_compbuf: Pointer; a2_clen: INT64; 
     a3_out: Pointer; a4_outlen: INT64; a5_crcflag: INT64; a5u: INT64; 
     a6_verb: INT64; a7_dict: Pointer; a8_dictsize: INT64; a9_cb: Pointer; 
     a10: INT64; a11: Pointer = 0; a12: INT64 = 0; a14: INT64 = 0) 
     : INT64 cdecl stdcall;external 'imp.dll'; 

回答

6

你不能在名稱中使用它,所以你需要使用一個有效的標識符導入函數。就像這樣:

function imp_Com(...): Int64; stdcall; external 'imp.dll' name '[email protected]'; 

函數不能同時的cdecl和STDCALL。不知道你的代碼是什麼。基於名字裝飾,這些功能是標準化的。