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. Thread Initialisation.......

Thread Initialisation.......

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++hardware
5 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.
  • D Offline
    D Offline
    Deepa Gopal
    wrote on last edited by
    #1

    :confused:Hi All, I have a problem in my embedded VC++ which is as follows: There is a Read Thread created during WM_CREATE event, which is supposed to read data from the COM1 port as and when it receives data.I have created the thread in such a way that it is active right from the point of creation - hReadThread = CreateThread (NULL, 0, PortRead, 0, 0, &dwThreadId); The problem is I dont know why the data is not read from COM1 though the read thread is active right from start. It would be very helpful if you could kindly help em out. Thanx Deepa.

    R _ 2 Replies Last reply
    0
    • D Deepa Gopal

      :confused:Hi All, I have a problem in my embedded VC++ which is as follows: There is a Read Thread created during WM_CREATE event, which is supposed to read data from the COM1 port as and when it receives data.I have created the thread in such a way that it is active right from the point of creation - hReadThread = CreateThread (NULL, 0, PortRead, 0, 0, &dwThreadId); The problem is I dont know why the data is not read from COM1 though the read thread is active right from start. It would be very helpful if you could kindly help em out. Thanx Deepa.

      R Offline
      R Offline
      RadioShark
      wrote on last edited by
      #2

      Hi, Are you sure that COM1 was not opened before your thread has started? Sincerely Yours, RadioShark

      D 1 Reply Last reply
      0
      • D Deepa Gopal

        :confused:Hi All, I have a problem in my embedded VC++ which is as follows: There is a Read Thread created during WM_CREATE event, which is supposed to read data from the COM1 port as and when it receives data.I have created the thread in such a way that it is active right from the point of creation - hReadThread = CreateThread (NULL, 0, PortRead, 0, 0, &dwThreadId); The problem is I dont know why the data is not read from COM1 though the read thread is active right from start. It would be very helpful if you could kindly help em out. Thanx Deepa.

        _ Offline
        _ Offline
        _Magnus_
        wrote on last edited by
        #3

        Why dont you just debug the read thread and see what happens? /Magnus


        - I don't necessarily agree with everything I say

        1 Reply Last reply
        0
        • R RadioShark

          Hi, Are you sure that COM1 was not opened before your thread has started? Sincerely Yours, RadioShark

          D Offline
          D Offline
          Deepa Gopal
          wrote on last edited by
          #4

          Hi, Actually I am reading from COM7 using a bluetooth gateway.I have opened COM7 before creating the read thread. Regards, Deepa.

          R 1 Reply Last reply
          0
          • D Deepa Gopal

            Hi, Actually I am reading from COM7 using a bluetooth gateway.I have opened COM7 before creating the read thread. Regards, Deepa.

            R Offline
            R Offline
            RadioShark
            wrote on last edited by
            #5

            Hi, Investigate return code after attemp of opening the port. I think that you have to open COM7 in the same thread. Sincerely Yours, RadioShark

            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