-
Argument not specified for parameter 'ComPortName' of 'Public Sub New(ComPortName)
I am working on an application using COMPort.
Application executed successfully.
Then, i created another module by adding a COM reference.
This also executed successfully.
But when integrating both:- Error is coming- Argument not specified for parameter 'ComPortName' of 'Public Sub New(ComPortName As String)'
Imports AxSerial
Imports System.Windows.Threading
Public Class DeviceInfo
Private _objComport As AxSerial.ComPort = New COMPort()
Private Sub DeviceInfo_Loaded(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Loaded
Dim i As System.Int32
lst_device.Items.Clear()
For i = 0 To _objComport.GetDeviceCount() - 1
Dim devName = _objComport.GetDeviceName(i)
lst_device.Items.Add(devName)
Next
End Sub
End Class
Above code executed successfully. Now, I also want to integrate below code within above module.
Imports System.IO.Ports
Dim Ports() As String = System.IO.Ports.SerialPort.GetPortNames()
but when i compile after integrating both, Error is coming- Argument not specified for parameter 'ComPortName' of 'Public Sub New(ComPortName As String)' & line highlighted is-
Private _objComport As AxSerial.ComPort = New COMPort()
Please guide how to resolve.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules