Public Declare Function GetProductName Lib "DogDll.dll" () As Long
Public Declare Function GetSoftWare Lib "DogDll.dll" () As Long
Public Declare Function GetSoftTime Lib "DogDll.dll" () As Long
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
上面是DLL里的函数,请问我在VB里怎样调用?我用下面的代码调用
Private Sub Command1_Click()
Dim tt As Long
Dim MySnapHandle As Long tt = LoadLibrary("DogDll.dll")'
If tt > 0 Then
tt = GetSoftWare
End If
'MySnapHandle = GetProcAddress(tt, GetSoftWare) 'GetProductName
'MsgBox MySnapHandle
End Sub
后出现如下的错误提示:"Bad dll calling convention"
Public Declare Function GetSoftWare Lib "DogDll.dll" () As Long
Public Declare Function GetSoftTime Lib "DogDll.dll" () As Long
Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
上面是DLL里的函数,请问我在VB里怎样调用?我用下面的代码调用
Private Sub Command1_Click()
Dim tt As Long
Dim MySnapHandle As Long tt = LoadLibrary("DogDll.dll")'
If tt > 0 Then
tt = GetSoftWare
End If
'MySnapHandle = GetProcAddress(tt, GetSoftWare) 'GetProductName
'MsgBox MySnapHandle
End Sub
后出现如下的错误提示:"Bad dll calling convention"
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货