主题:学习freelibrary的使用问题
学习freelibrary的使用,有以下问题
VB codePrivate Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Sub Command1_Click()
Dim a As Long
Dim b As Long
Dim c As Long
Call LoadLibrary("BASSMOD.dll")
a = GetModuleHandle("BASSMOD.dll")
c = FreeLibrary(a)
b = GetModuleHandle("BASSMOD.dll")
End Sub
问题:释放指定的动态链接库BASSMOD.dll后,b = GetModuleHandle("BASSMOD.dll")还是执行成功,b>0, 应该b=0啊,因为已经释放了.请问是怎么回事.
VB codePrivate Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Sub Command1_Click()
Dim a As Long
Dim b As Long
Dim c As Long
Call LoadLibrary("BASSMOD.dll")
a = GetModuleHandle("BASSMOD.dll")
c = FreeLibrary(a)
b = GetModuleHandle("BASSMOD.dll")
End Sub
问题:释放指定的动态链接库BASSMOD.dll后,b = GetModuleHandle("BASSMOD.dll")还是执行成功,b>0, 应该b=0啊,因为已经释放了.请问是怎么回事.