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 and serial port

Thread and serial port

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • M Offline
    M Offline
    Mavrock
    wrote on last edited by
    #1

    I am new to programming. I have been given the task of making an application that recieves commands via the serial port. and then displays a notification that the commands were recieved. I have been told that I need to use a thread to do this. I'm not sure where the thread goes, I.E does it go in the source file or the header file? Or do I declare it in the header file and then put the functionality in the OnInitialDialog function? Thank you for any help. Mavrock

    L 1 Reply Last reply
    0
    • M Mavrock

      I am new to programming. I have been given the task of making an application that recieves commands via the serial port. and then displays a notification that the commands were recieved. I have been told that I need to use a thread to do this. I'm not sure where the thread goes, I.E does it go in the source file or the header file? Or do I declare it in the header file and then put the functionality in the OnInitialDialog function? Thank you for any help. Mavrock

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Mavrock, I have done something similar but nowhere near doing an article yet. Basically: 1. Create a dialogue box 2. Insert the Mircosoft communications ActiveX component into it. 3. Create a variable name for the ActiveX component. This then creates a class for the MSCOMM component (prompt displayed). 4. Set the RThreshold property to 1. This causes an OnCommEvent for every character received. 5. In the OnCommEvent() procedure, event 2 is for soemthing received. If you want a small sample project let me have your email address and I'll forward it. I have used this on Win98 and NT4 with no problems. Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?

      M 1 Reply Last reply
      0
      • L Lost User

        Mavrock, I have done something similar but nowhere near doing an article yet. Basically: 1. Create a dialogue box 2. Insert the Mircosoft communications ActiveX component into it. 3. Create a variable name for the ActiveX component. This then creates a class for the MSCOMM component (prompt displayed). 4. Set the RThreshold property to 1. This causes an OnCommEvent for every character received. 5. In the OnCommEvent() procedure, event 2 is for soemthing received. If you want a small sample project let me have your email address and I'll forward it. I have used this on Win98 and NT4 with no problems. Elaine (fluffy tigress emoticon) Would you like to meet my teddy bear ?

        M Offline
        M Offline
        Mavrock
        wrote on last edited by
        #3

        Dear Elaine, Thank you for the direction. If you don't mind I would really like to see your sample project. You can send it to me at stonematthies@hotmail.com. thanks. Mavrock

        D 1 Reply Last reply
        0
        • M Mavrock

          Dear Elaine, Thank you for the direction. If you don't mind I would really like to see your sample project. You can send it to me at stonematthies@hotmail.com. thanks. Mavrock

          D Offline
          D Offline
          dlhson
          wrote on last edited by
          #4

          On this site codeproject.com and on codeguru.com, you can find many articles about your topic Hung Son A Vietnamese student i-g.hypermart.net dlhson2001@yahoo.com

          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