调用api函数出错

softzhou 2002-11-05 10:43:48
我调用api 函数RegOpenKey,在声明处:
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal phkResult As Long) As Long
定义'HKEY_LOCAL_MACHINE = &H80000002'
调用 RegOpenKey (HKEY_LOCAL_MACHINE,...,...)
出错
...全文
28 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Montaque 2002-11-06
  • 打赏
  • 举报
回复
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal phkResult As Long) As Long
把所有long类型改为integer
载vb.net中,Integer是32位的,相当于原来的long
saucer 2002-11-05
  • 打赏
  • 举报
回复
what error did you get?

it is easier to use Microsoft.Win32.Registry class, but you insist, see

http://www.allapi.net/apilist/RegOpenKey.shtml

see the example part

16,555

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧