将 PtrSafe 添加到 vba 对第 3 方 dll 的函数调用导致 64 位错误 Excel
adding PtrSafe to vba function call into 3rd party dll causes error in 64-bit Excel
我有一个 VBA 项目,它对第 3 方 dll 进行了 3 次调用,如下所示:
Private Declare Function cm_checkprotection Lib "ACPPYRAMID.DLL" Alias "CM_CheckProtection" (ByVal options As Long) As Long
Private Declare Function cm_getextendederror Lib "ACPPYRAMID.DLL" Alias "CM_GetExtendedError" (ByVal ExtErr As Any) As Long
Private Declare Function cm_getproductkeya Lib "ACPPYRAMID.DLL" Alias "CM_GetProductKeyA" (ByVal ProductKey As Any) As Long
我正在尝试将此项目移植到 64 位 Excel,但是当我将 'PtrSafe' 添加到声明时,Excel barfs 出现 "Expected: Expression" 错误,如附图所示。
知道如何解决这个问题吗?
TIA,
弗兰克
移动位置到
Private Declare PtrSafe Function
我有一个 VBA 项目,它对第 3 方 dll 进行了 3 次调用,如下所示:
Private Declare Function cm_checkprotection Lib "ACPPYRAMID.DLL" Alias "CM_CheckProtection" (ByVal options As Long) As Long
Private Declare Function cm_getextendederror Lib "ACPPYRAMID.DLL" Alias "CM_GetExtendedError" (ByVal ExtErr As Any) As Long
Private Declare Function cm_getproductkeya Lib "ACPPYRAMID.DLL" Alias "CM_GetProductKeyA" (ByVal ProductKey As Any) As Long
我正在尝试将此项目移植到 64 位 Excel,但是当我将 'PtrSafe' 添加到声明时,Excel barfs 出现 "Expected: Expression" 错误,如附图所示。
知道如何解决这个问题吗?
TIA,
弗兰克
移动位置到
Private Declare PtrSafe Function