gpt4 book ai didi

delphi - 用@调用函数

转载 作者:行者123 更新时间:2023-12-03 18:18:04 26 4
gpt4 key购买 nike

我需要在 Delphi 中从外部 DLL 调用函数,该函数定义了调用的字节,我应该如何调用它们,在 Delphi 中声明它们时,它显示预期的语法错误;取而代之的是@

function _imp_Com@32(a1: INT64; a2: Pointer; a3: INT64; a4: Pointer;
a5: INT64; a6: Pointer; a7: Pointer; a8: INT64): INT64 cdecl stdcall;external 'imp.dll';

function _imp_Decom@56(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';

最佳答案

您不能在名称中使用它,因此您需要使用有效标识符导入函数。像这样:

function imp_Com(...): Int64; stdcall; external 'imp.dll' name '_imp_Com@32';

一个函数不能既是cdecl又是stdcall。不确定您的代码中的内容。根据名称修饰,这些函数是 stdcall。

关于delphi - 用@调用函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42177777/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com