Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Windows SDK Communication Question

Windows SDK Communication Question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++visual-studio
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jethro63
    wrote on last edited by
    #1

    Greetings: Does anybody know anything about a limit to the COMn designation that can be successfully opened by the "CreateFile" SDK function? We have serial ports here that can take mappings greater than 9 (ie: COM10, COM11, etc...). "CreateFile" returns NULL for anything greater than COM9. Does anybody know a way of getting around this? Its Windows XP-Pro at the moment, but we have to expect our application to run on other versions as well. I'm using VS 2003 and MFC. Thank you, Mark

    R 1 Reply Last reply
    0
    • J Jethro63

      Greetings: Does anybody know anything about a limit to the COMn designation that can be successfully opened by the "CreateFile" SDK function? We have serial ports here that can take mappings greater than 9 (ie: COM10, COM11, etc...). "CreateFile" returns NULL for anything greater than COM9. Does anybody know a way of getting around this? Its Windows XP-Pro at the moment, but we have to expect our application to run on other versions as well. I'm using VS 2003 and MFC. Thank you, Mark

      R Offline
      R Offline
      Roger Stoltz
      wrote on last edited by
      #2

      Jethro63 wrote:

      Does anybody know anything about a limit to the COMn designation that can be successfully opened by the "CreateFile" SDK function?

      This is special case code (or hack) in the implementation of ::CreateFile() that recognizes the filename "COM" followed by one single integer. You can have COM ports from COM1 to COM255, but for port numbers above 9 you have to use "\\\\.\\COMnnn" as filename, e.g. "\\\\.\\COM10".


      "It's supposed to be hard, otherwise anybody could do it!" - selfquote
      "High speed never compensates for wrong direction!" - unknown

      J 1 Reply Last reply
      0
      • R Roger Stoltz

        Jethro63 wrote:

        Does anybody know anything about a limit to the COMn designation that can be successfully opened by the "CreateFile" SDK function?

        This is special case code (or hack) in the implementation of ::CreateFile() that recognizes the filename "COM" followed by one single integer. You can have COM ports from COM1 to COM255, but for port numbers above 9 you have to use "\\\\.\\COMnnn" as filename, e.g. "\\\\.\\COM10".


        "It's supposed to be hard, otherwise anybody could do it!" - selfquote
        "High speed never compensates for wrong direction!" - unknown

        J Offline
        J Offline
        Jethro63
        wrote on last edited by
        #3

        Hey! That, like, totally worked!!! :cool: Thanks! Mark

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups