Hey All,
So far I have put this wrapper together in VB.NET but am having trouble
trying to call the CConnMgrEstablishConnection method. Could someone show me
an example of how to do this?
Really need help on this one so hope you can help.
Dave Hanson
Imports System.Runtime.InteropServices
Public Class ConnMan
Private Const LocateDll As String = "Coredll.dll"
Public Structure CONNMGR_CONNECTIONINFO
Public cbSize As System.UInt32 'ToDo: Unsigned Integers not
supported
Public dwParams As System.UInt32 'ToDo: Unsigned Integers not
supported
Public dwFlags As System.UInt32 'ToDo: Unsigned Integers not
supported
Public dwPriority As System.UInt32 'ToDo: Unsigned Integers not
supported
Public bExclusive As System.UInt32 'ToDo: Unsigned Integers not
supported
Public bDisabled As System.UInt32 'ToDo: Unsigned Integers not
supported
Public guidDestNet() As Byte
Public hWnd As Integer
Public uMsg As System.UInt32 'ToDo: Unsigned Integers not supported
Public lParam As Integer
Public ulMaxCost As System.UInt64 'ToDo: Unsigned Integers not
supported
Public ulMinRcvBw As System.UInt64 'ToDo: Unsigned Integers not
supported
Public ulMaxConnLatency As System.UInt64 'ToDo: Unsigned Integers
not supported
End Structure 'CONNMGR_CONNECTIONINFO
Public CONNMGR_STATUS_UNKNOWN As Long = &H0
Public CONNMGR_STATUS_CONNECTED As Long = &H10
Public CONNMGR_STATUS_DISCONNECTED As Long = &H20
Public CONNMGR_STATUS_CONNECTIONFAILED As Long = &H21
Public CONNMGR_STATUS_CONNECTIONCANCELED As Long = &H22
Public CONNMGR_STATUS_CONNECTIONDISABLED As Long = &H23
Public CONNMGR_STATUS_NOPATHTODESTINATION As Long = &H24
Public CONNMGR_STATUS_WAITINGFORPATH As Long = &H25
Public CONNMGR_STATUS_WAITINGFORPHONE As Long = &H26
Public CONNMGR_STATUS_WAITINGCONNECTION As Long = &H40
Public CONNMGR_STATUS_WAITINGFORRESOURCE As Long = &H41
Public CONNMGR_STATUS_WAITINGFORNETWORK As Long = &H42
Public CONNMGR_STATUS_WAITINGDISCONNECTION As Long = &H80
Public CONNMGR_STATUS_WAITINGCONNECTIONABORT As Long = &H81
<DllImport(LocateDll)> _
Public Shared Function ConnMgrConnectionStatus(ByVal hConnection As
Long, ByRef pdwSatus As Long) As Long
End Function
<DllImport(LocateDll)> _
Public Shared Sub ConnMgrEnumDestinations(ByVal nIndex As Integer, ByRef
pDestInfo As CONNMGR_CONNECTIONINFO)
End Sub
<DllImport(LocateDll)> _
Public Shared Function CConnMgrEstablishConnection(ByRef pConnInfo As
CONNMGR_CONNECTIONINFO, ByRef hConnection As Long) As Long
End Function
<DllImport(LocateDll)> _
Public Shared Function ConnMgrEstablishConnectionSync(ByVal pConnInfo As
IntPtr, ByRef phConnection As IntPtr, ByVal dwTimeout As Integer, ByRef
pdwStatus As IntPtr) As IntPtr
End Function
<DllImport(LocateDll)> _
Public Shared Function ConnMgrMapURL(ByVal pwszURL As String, ByRef
pguid As Guid, ByRef pdwIndex As IntPtr) As IntPtr
End Function
End Class
|