Results 1 to 10 of 10

Thread: MSComm

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2013
    Posts
    62

    MSComm

    I am using MSComm in my application .. how can i get connected com port name like in image


  2. #2

    Thread Starter
    Member
    Join Date
    Nov 2013
    Posts
    62

    Re: MSComm

    Any help please

  3. #3

    Thread Starter
    Member
    Join Date
    Nov 2013
    Posts
    62

    Re: MSComm

    it is unacceptable that on great forum with great and experienced members are not replying

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,905

    Re: MSComm

    I would ask for a refund.

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: MSComm

    Quote Originally Posted by stiphen View Post
    it is unacceptable that on great forum with great and experienced members are not replying
    Unacceptable? No one here gets paid for their services, you do not pay anything and it has only been a few hours since you asked the question.

    One of the first things a programmer needs to learn is patience, you won't last long without it

    As for your question, no you can not retrieve that info using MSComm control and that is not the name of the port. The port is Comxx the additional info is related to hardware attached to that port. While there may be a way to get this info using API calls I have never looked into it.

  6. #6

    Thread Starter
    Member
    Join Date
    Nov 2013
    Posts
    62

    Re: MSComm

    thanks for suggestion Data-Miser

  7. #7
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: MSComm

    Quote Originally Posted by stiphen View Post
    it is unacceptable that on great forum with great and experienced members are not replying
    no problem this can be achieved by placing a combo1 on form and copy and paste this code , this will show you the connected serial ports but not sure about usb modem ports .. see if this will help you

    Code:
    Private Sub Form_Load()
    Combo1.Clear 
    Set WMIObjectSet = GetObject("winmgmts:\\.\root\CIMV2").ExecQuery("SELECT * FROM Win32_PnPEntity")
    For Each wmiobject In WMIObjectSet
    If InStr(wmiobject.Name, "COM") Then
       If InStr(wmiobject.Name, "COM ") Then GoTo nope
          Combo1.AddItem wmiobject.Name
    nope: End If
          Next
         Set WMIObjectSet = Nothing
         
    com_port_sel_frame.Visible = True
    End Sub

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: MSComm

    WMI is not meant to be used in applications. It's an admin scripting tool.

    The WMI service is often disabled for security reasons.

  9. #9
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: MSComm

    then what would be the proper way to get as OP asked .

  10. #10
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: MSComm

    There really isn't any.

    If you search you'll find there are several possible ways to do this, but most of them can miss some ports entirely and others will report other types of ports as COM ports.

    WMI for example will often miss some vendors' USB COM ports entirely.

    Windows appears to do this using SetupAPI or something similar, but the filtering rules are not documented. So there is no reliable way to get the information that anyone knows of.

    See How do I get a list of available serial ports in Win32?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width