Click here to Skip to main content
Click here to Skip to main content

EnumSerialPorts v1.02 - Enumerating Serial Ports

, 3 Mar 2000
Rate this:
Please Sign up or sign in to vote.
A freeware MFC function to enumerate serial ports.
  • 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

    Share

    About the Author

    PJ Naughter

    United States United States
    No Biography provided

    Comments and Discussions

     
    GeneralUintArray Pinmemberdrequinox4-Sep-06 10:44 

    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.

    | Advertise | Privacy | Mobile
    Web04 | 2.8.140827.1 | Last Updated 4 Mar 2000
    Article Copyright 2000 by PJ Naughter
    Everything else Copyright © CodeProject, 1999-2014
    Terms of Service
    Layout: fixed | fluid