M
Mack
Have tried varying declares for the api call, i need to close a
connection even if resources are open (damn perfcounters)
It suggests that you can use a true (dim as a bool in the api
declare), this doesn't work, it always tells me the
getlasterrormessage of
'This network connection has files open or requests pending.'
I've tried using 1,-1 (after dimming as a long) as values, but they
still fail also
TIA
Cheers
Mack
GtErrorMessage(WNet.WNetCancelConnection2("\\192.168.1.2",0, 0))
Class WNet
<StructLayout(LayoutKind.Sequential)> _
Public Class NETRESOURCE
Public dwScope As Integer
Public dwType As Integer
Public dwDisplayType As Integer
Public dwUsage As Integer
Public lpLocalName As String
Public lpRemoteName As String
Public lpComment As String
Public lpProvider As String
End Class
Public Declare Ansi Function WNetAddConnection2 Lib "mpr.dll"
Alias "WNetAddConnection2A" (ByVal lpNetResource As NETRESOURCE, ByVal
lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As
Integer) As Integer
Public Declare Ansi Function WNetCancelConnection2 Lib "mpr.dll"
Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags
As Long, ByVal fForce As Long) As Integer
End Class
connection even if resources are open (damn perfcounters)
It suggests that you can use a true (dim as a bool in the api
declare), this doesn't work, it always tells me the
getlasterrormessage of
'This network connection has files open or requests pending.'
I've tried using 1,-1 (after dimming as a long) as values, but they
still fail also
TIA
Cheers
Mack
GtErrorMessage(WNet.WNetCancelConnection2("\\192.168.1.2",0, 0))
Class WNet
<StructLayout(LayoutKind.Sequential)> _
Public Class NETRESOURCE
Public dwScope As Integer
Public dwType As Integer
Public dwDisplayType As Integer
Public dwUsage As Integer
Public lpLocalName As String
Public lpRemoteName As String
Public lpComment As String
Public lpProvider As String
End Class
Public Declare Ansi Function WNetAddConnection2 Lib "mpr.dll"
Alias "WNetAddConnection2A" (ByVal lpNetResource As NETRESOURCE, ByVal
lpPassword As String, ByVal lpUserName As String, ByVal dwFlags As
Integer) As Integer
Public Declare Ansi Function WNetCancelConnection2 Lib "mpr.dll"
Alias "WNetCancelConnection2A" (ByVal lpName As String, ByVal dwFlags
As Long, ByVal fForce As Long) As Integer
End Class