delphi 7中dll函数中的布尔参数

Pau*_*aul 3 delphi dll boolean

我有一个DLL库.我已经排除了delphi类型的内存单元.

那样,Boolean函数声明的适当类型是什么?

是它BOOL还是别的什么?

问题是在方法签名中:

function Test(Param1: BOOL; Param2: BOOL; docContent: PCharArray): Integer;
Run Code Online (Sandbox Code Playgroud)

当程序离开该功能时,我得到AV.

我假设这两个第一个参数的数据类型存在问题.

Rob*_*edy 6

BOOL适用于布尔类型.它是Windows类型,因此您将在Windows.pas中的所有功能中看到它.

从DLL函数返回时的访问冲突通常表明您的调用约定错误 - 默认调用约定是register,但您可能需要stdcallcdecl.在声明的最后添加:

function Test(Param1: BOOL; Param2: BOOL; docContent: PCharArray): Integer; stdcall;
Run Code Online (Sandbox Code Playgroud)