Learn how to a build a cloud-first strategyRegister Now


c# serial port modal form on top stops receiving.

Posted on 2012-08-31
Medium Priority
Last Modified: 2012-09-03
Im using VS 2005 C# WinCE6, I am using the serial port component to take in data.

It seems that when another modal form goes on top of the first the serial port stops receiving data and then when the modal form goes the port either stops working or suddenly all the data appears.

The worst is when it stops receiving data. The received event stops firing.

What is a way around this ? An example would be good.

Do I run the serial port in another thread or stop it when the modal windows is shown.
Question by:qicblue

Expert Comment

ID: 38354696
if you use timer ?

if Yes:

use event on SerialPort1_DataReceived

if No:

Use Timer 100msec SerialPort1.ReadLine
LVL 55

Accepted Solution

Jaime Olivares earned 1000 total points
ID: 38354734
You definitively need to put the listener function in a separated thread, because if you stay to much in the modal window, a timeout will occur.
Be aware that you may need to use a cross-thread UI technique to avoid an exception when updating your UI from the secondary thread.

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question