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. Application hangs when trying to open comport

Application hangs when trying to open comport

Scheduled Pinned Locked Moved C / C++ / MFC
jsonhelp
3 Posts 3 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.
  • S Offline
    S Offline
    sunny_vc
    wrote on last edited by
    #1

    Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..

    Regards, Sunil Kumar

    R CPalliniC 2 Replies Last reply
    0
    • S sunny_vc

      Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..

      Regards, Sunil Kumar

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

      How do you open the device? Or in other words: what does your call to ::CreateFile() look like? (Post the code.) Whenever you're developing software that communicates with communications port, it's usually very nice to have an application that tells you what is going on under the hood. I always use PortMon[^] written by Mark Russinovich. It will tell you exactly what Hyperterminal and your application is doing.

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

      1 Reply Last reply
      0
      • S sunny_vc

        Hi all, Iam facing some strange problem with my application. My application uses Comport to communciate with the device. If my application only opened, I can open the serial port and close the port without any problem. If I open my application and just close the serialport and open hyperterminal and connect it , after some work on hyperterminal again i want to switch to my application by disconnecting hyperterminal. When I am opening the port again in my application my application hangs, When it calls any API of comport like, SetCommState()as it is never returning from it. Why application is hanging when hypertermianl opened and closed in between applciation open uart and close uart. Thanks in advance..

        Regards, Sunil Kumar

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        It may happen if your application (wrongly) relies on some initial state of the serial device (and the Hyperterminal alters it). As remarked by Roger Stoltz, without posting the relevant code, you hardly will get any help. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        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