Click here to Skip to main content
Licence 
First Posted 3 Mar 2000
Views 160,543
Bookmarked 37 times

EnumSerialPorts v1.02 - Enumerating Serial Ports

By PJ Naughter | 3 Mar 2000
A freeware MFC function to enumerate serial ports.
1 vote, 7.1%
1
1 vote, 7.1%
2
1 vote, 7.1%
3
3 votes, 21.4%
4
8 votes, 57.1%
5
4.77/5 - 28 votes
2 removed
μ 4.30, σa 2.26 [?]
  • Download source files - 7 Kb
  • Introduction

    Welcome to EnumSerialPorts v1.01, a simple MFC function to enumerate the serial ports installed on your machine.


    Features
    Usage
    History
    API Reference
    Contacting the Author


    Features

    • Simple C style function interface.
    • The code works on both Windows 95/98 and NT.
    • The code is fully Unicode compliant and include Unicode built options in the workspace file.


    Usage

    • To use the function in your code simply #include "enumser.cpp" in your project and #include "enumser.h" in which ever of your modules needs to make calls to the function.
    • Your code will need to include MFC either statically or dynamically.
    • To see the class in action, have a look at the main function in the module main.cpp.


    History

    v1.0 (3 November 1998)
    • Initial Public release.

    v1.01 (23 February 1999)

    • Code now uses QueryDosDevice() if running on NT to determine which serial ports are available. This avoids having to open the ports at all. It should operate a lot faster in addition.

    V1.02 (12 December 1999)

    • Fixed a problem in the Win9x code path when trying to detect deactivated IRDA-ports. When trying to open those, you will get the error-code ERROR_GEN_FAILURE.


    API Reference

    EnumerateSerialPorts

    void ::EnumerateSerialPorts(CUIntArray& ports);

    Parameters:

    • ports -- Upon return this array will contain the port numbers of all the serial ports installed on the computer.



    Contacting the Author

    PJ Naughter
    Email: pjn@indigo.ie
    Web: http://www.naughter.com
    12 December 1999


    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    PJ Naughter



    United States United States

    Member


    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralUintArray Pinmemberdrequinox11:44 4 Sep '06  
    GeneralProblem: Other devices starting with "Com"... PinmemberSupermagle4:03 11 Nov '05  
    GeneralRe: Problem: Other devices starting with "Com"... PinmemberSupermagle4:12 11 Nov '05  
    GeneralVIRTUAL SERIAL PORT PinmemberJoseph19:53 26 May '03  
    GeneralRe: VIRTUAL SERIAL PORT PinmemberJLT7617:28 23 Feb '05  
    GeneralSuggestion for another method Pinmemberchris1094:03 19 Mar '02  
    GeneralThe way I do it ... Pinmemberanonymous8:36 24 Aug '01  
    GeneralIncorrect COM0 detection PinmemberAnonymous21:26 6 Aug '01  
    GeneralRe: Incorrect COM0 detection PinmemberAnonymous15:18 12 Aug '01  
    GeneralRe: Incorrect COM0 detection PinmemberAnonymous15:31 12 Aug '01  
    GeneralThere is a better way to enumerate ports... PinmemberChristian B2:15 25 Jul '01  
    GeneralHelp for Windows CE PinmemberChris Pichon6:48 19 May '01  
    GeneralRe: Help for Windows CE Pinmembersusilrani1:22 9 May '08  
    Generali need to detect a modem . . . Pinsussguy6:37 19 Sep '00  
    GeneralUse vector instead of CUIntArray Pinsussleowlf17:22 9 Apr '00  
    GeneralRe: Use vector instead of CUIntArray PinsussPJ Naughter14:57 16 May '00  
    GeneralRe: Use vector instead of CUIntArray PinmemberAnonymous5:50 19 Apr '02  
    GeneralVirtual Ports PinsussCMG13:06 4 Apr '00  
    GeneralRe: Virtual Ports PinsussPJ Naughter12:46 5 Apr '00  
    GeneralRe: Virtual Ports PinsussEldad Kuperman0:25 13 Apr '00  
    GeneralRe: Virtual Ports PinsussEldad Kuperman0:27 13 Apr '00  
    GeneralRe: Virtual Ports PinsussPJ Naughter15:00 16 May '00  
    GeneralRe: Virtual Ports PinsussPJ Naughter4:13 17 May '00  
    GeneralRe: Virtual Ports PinmemberGin Hwee22:52 2 Sep '01  
    GeneralRe: Virtual Ports PinsussAnonymous0:38 12 Dec '03  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web03 | 2.5.120210.1 | Last Updated 4 Mar 2000
    Article Copyright 2000 by PJ Naughter
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid