以下是加载外部 dll 的一个例子,其中 winspool.drv 换成你dll的路径,如果把你的 dll 放在系统目录中,就不用写路径,直接写你 dll 的文件名就可以了:
Public Declare Function AddMonitor Lib "winspool.drv" Alias "AddMonitorA" (ByVal pName As String, ByVal Level As Long, pMonitors As Byte) As Long
当然,如果 dll 是用 VB 写的,那么就不是这样引用了,VB 写的 DLL 引用如下:工程菜单->引用菜单,找到你的 DLL 实例打上勾点确定就好了。
温馨提示:答案为网友推荐,仅供参考