T
Terry Olsen
Trying to use AddPortEx but I'm getting an error. I modified the code I
found that Randy Birch did for VB6.
Public Structure PORT_INFO_1
Dim pPortName As String
End Structure
Public Declare Function AddPortEx Lib "winspool.drv" Alias "AddPortExA"
(ByVal pName As String, ByVal pLevel As Integer, ByVal lpBuffer As Object,
ByVal pMonitorName As String) As Integer
Dim PortInfo1 As PORT_INFO_1
PortInfo1.pPortName = FilePath
Dim x As Integer = AddPortEx(Nothing, 1, PortInfo1, "Local Port")
<--Exception thrown here
The error i'm getting is "Value does not fall within the expected range"
Looking for help getting this to work.
Thanks.
found that Randy Birch did for VB6.
Public Structure PORT_INFO_1
Dim pPortName As String
End Structure
Public Declare Function AddPortEx Lib "winspool.drv" Alias "AddPortExA"
(ByVal pName As String, ByVal pLevel As Integer, ByVal lpBuffer As Object,
ByVal pMonitorName As String) As Integer
Dim PortInfo1 As PORT_INFO_1
PortInfo1.pPortName = FilePath
Dim x As Integer = AddPortEx(Nothing, 1, PortInfo1, "Local Port")
<--Exception thrown here
The error i'm getting is "Value does not fall within the expected range"
Looking for help getting this to work.
Thanks.