borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Copy Folder on CD)Next Topic (text formatting in a text box.) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Comm port list
Poster Message
TiBlay
Level: Guest


icon Comm port list

Hello,

I try to retreive the list of serial port available on win. I try Find the COM ports available on your PC but i receive always -1 (False), i running on Win98, and i not test on other WIN.  Any body have already do the list on serial port available

Thank you

p.s. excuse my english  

Steve Tremblay

17-03-2004 at 02:05 AM
| Quote Reply
steve_w
Level: Moderator


Registered: 18-04-2003
Posts: 1137
icon Re: Comm port list

Heres the link for anyone else
http://www.andreavb.com/tip040001.html

Hi TiBlay

It works on my pc. Try the code below instead but this will only show free ports. You will also need the Microsoft Comm Control.

Private Sub Command2_Click()

On Error Resume Next ' IN CASE OF INVALID PORTS

    For i = 1 To 16
    
        MSComm1.CommPort = i
        
        MSComm1.PortOpen = True
        
        If MSComm1.PortOpen = True Then
            MsgBox "COM" & i & " OK", vbInformation
            MSComm1.PortOpen = False
        Else
            MsgBox "COM" & i & " Not OK", vbExclamation
        End If
        
    Next i

End Sub


Steve

17-03-2004 at 09:12 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Comm port list
Previous Topic (Copy Folder on CD)Next Topic (text formatting in a text box.) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2014 Andrea Tincaniborder