<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function LoadLibrary(<[In](), MarshalAs(UnmanagedType.LPStr)> ByVal lpFileName As String) As IntPtr
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Public Shared Function FreeLibrary(<[In]()> ByVal hModule As IntPtr) As Boolean
End Function
'==============================
BASSMOD_MusicStop()
BASSMOD_Free() 'don't know if this is still needed since I'm doing it myself
Dim hAddress As Long = GetModuleHandle("bassmod.dll")
While hAddress >= 1
FreeLibrary(hAddress)
hAddress = GetModuleHandle("bassmod.dll")
End While
File.Delete("bassmod.dll")
Have to loop it for some reason, as just one call doesn't seem to take care of it.
Minimal overhead, but it works.
