【发布时间】:2014-08-25 03:19:39
【问题描述】:
我正在尝试从 VBA 32 (Excel) 移植在 Excel 2013 64 位中不起作用的代码。 我需要读取 HASP 密钥,通常使用 hasvb32.dll。
' The main hasp API function
Private Declare Sub hasp Lib "haspvb32.dll" (ByVal Service, ByVal seed, ByVal lpt, ByVal pass1, ByVal pass2, retcode1, retcode2, retcode3, retcode4 As Any)
' WriteHaspBlock function prepares memory for the WriteBlock service
Private Declare Sub WriteHaspBlock Lib "haspvb32.dll" (ByVal Service, Buff As Any, ByVal Length)
' ReadHaspBlock function prepares memory for the WriteBlock service
Private Declare Sub ReadHaspBlock Lib "haspvb32.dll" (ByVal Service, Buff As Any, ByVal Length)
have made the changes to:
' The main hasp API function
Private Declare PtrSafe Sub hasp Lib "haspvb32.dll" (ByVal Service, ByVal seed, ByVal lpt, ByVal pass1, ByVal pass2, retcode1, retcode2, retcode3, retcode4 As Any)
' WriteHaspBlock function prepares memory for the WriteBlock service
Private Declare PtrSafe Sub WriteHaspBlock Lib "haspvb32.dll" (ByVal Service, Buff As Any, ByVal Length)
' ReadHaspBlock function prepares memory for the WriteBlock service
Private Declare PtrSafe Sub ReadHaspBlock Lib "haspvb32.dll" (ByVal Service, Buff As Any, ByVal Length)
没有成功。任何想法? 谢谢
【问题讨论】:
-
嗨,下面的答案有帮助吗?如果有,请将其标记为已回答。谢谢
标签: vba excel 32bit-64bit