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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. process termination issue

process termination issue

Scheduled Pinned Locked Moved C / C++ / MFC
helpcom
4 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.
  • R Offline
    R Offline
    Raj Prathap
    wrote on last edited by
    #1

    hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap

    M S 2 Replies Last reply
    0
    • R Raj Prathap

      hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap

      M Offline
      M Offline
      Monty2
      wrote on last edited by
      #2

      What mechanism are you using to signal to the running threads that its time to stop?


      If you think you can than you can, if you think you can't you are right.

      R 1 Reply Last reply
      0
      • M Monty2

        What mechanism are you using to signal to the running threads that its time to stop?


        If you think you can than you can, if you think you can't you are right.

        R Offline
        R Offline
        Raj Prathap
        wrote on last edited by
        #3

        Thanks for the reply. Here is the way I'm terminating. 1. PostThreadMessage(WM_QUIT, NULL, NULL); 2. dwState = ::WaitForSingleObject(m_hThread, 6000); 3. if(dwState != WAIT_OBJECT_0) TerminateThread(m_hThread, dwExitCode); -- Pratap

        1 Reply Last reply
        0
        • R Raj Prathap

          hi, I'm facing some problem with the termination of the process. I have a COM DLL, which intern talks to a drive through a serial communication medium. And the COM Client, has some 5/6 threads runing. The problem is, *Some Times* when I close the application, the application never closes. Some threads of the process are still running, which prevents the usage of the serial port by the next instance of the application. Yet another problem is, the problem araises very rarely. Please help me!! Thanks in advance, Raja Pratap

          S Offline
          S Offline
          Stephen Hewitt
          wrote on last edited by
          #4

          Stack traces of what the application is doing when hung would be a big help. Also, what framework (if any) is being used?

          Steve

          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