VB中如何加载一个外部DLL

VB中如何加载一个外部DLL,第1张

添加一个标准模块,在模块中声明就可以。如

Public Declare Function AccessCheckAndAuditAlarm Lib "advapi32.dll" Alias "AccessCheckAndAuditAlarmA" (ByVal SubsystemName As String, HandleId As Any, ByVal ObjectTypeName As String, ByVal ObjectName As String, SecurityDescriptor As SECURITY_DESCRIPTOR, ByVal DesiredAccess As Long, GenericMapping As GENERIC_MAPPING, ByVal ObjectCreation As Long, GrantedAccess As Long, ByVal AccessStatus As Long, ByVal pfGenerateOnClose As Long) As Long

Public Declare Function AbortPath Lib "gdi32" Alias "AbortPath" (ByVal hdc As Long) As Long

Public Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long

函数入口声明肯定写错了,你看一下private declare function .....这句话,里面会出现函数名、dll文件名两个字符串,如果写错了 改过来,如果没错就是字符串后面可能出现了一个空格 去掉空格就好了,从网页上出现的代码经常会出现这种情况~~


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11608352.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-17
下一篇 2023-05-17

发表评论

登录后才能评论

评论列表(0条)

保存