CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: multi-threading

  1. #1
    Join Date
    Jun 2011
    Posts
    6

    multi-threading

    In my gui, i need to perform two task simultaneous.One is send a file via serial port communication and other is display the status of communication on GUI as static text .Both done in a single button control.For this whether i need to create separate thread?
    I try this without threading.First i send the some fixed size of file and then show the status and continue the same for full file size.But when i open other application like calculator,the status display going hangs.but the file transfer is progressed.

    Help required

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: multi-threading

    You should use additional thread(s) for serial communications. The best way (IMHO) would be using overlapped IO wirh a worker thread processing serial Input (read) and UI thread (with a message pump) processing serial Output (write)
    See the example in Serial Port I/O
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured