Click here to Skip to main content
16,005,141 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mad with GroupBox!!!!! Help!!!! Pin
Christian Graus2-Jun-05 16:18
protectorChristian Graus2-Jun-05 16:18 
GeneralA tricky priority problem Pin
Snowjim2-Jun-05 14:12
Snowjim2-Jun-05 14:12 
GeneralRe: A tricky priority problem Pin
Christian Graus2-Jun-05 14:27
protectorChristian Graus2-Jun-05 14:27 
GeneralRe: A tricky priority problem Pin
Snowjim2-Jun-05 22:50
Snowjim2-Jun-05 22:50 
GeneralRe: A tricky priority problem Pin
S. Senthil Kumar3-Jun-05 2:29
S. Senthil Kumar3-Jun-05 2:29 
GeneralRe: A tricky priority problem Pin
Snowjim3-Jun-05 7:58
Snowjim3-Jun-05 7:58 
GeneralRe: A tricky priority problem Pin
S. Senthil Kumar3-Jun-05 8:13
S. Senthil Kumar3-Jun-05 8:13 
GeneralRe: A tricky priority problem Pin
Snowjim3-Jun-05 8:44
Snowjim3-Jun-05 8:44 
Yes i am using the SerialPort.DataReceived Event.

I have done some more testing now!

In the DataReceived event funktioner(the funktion that the DataReceived envet will run) u placed the code that writes the data to the file, like this:

<br />
                lock (this)<br />
                {<br />
                    if (RUNNING)<br />
                    {<br />
                        RemovePortHandlerRAW.Write(serialPort.ReadExisting());<br />
                        RemovePortHandlerRAW.Flush();<br />
                        /*<br />
                        ThreadPool.QueueUserWorkItem(new WaitCallback(onDataReceived));<br />
                        currentRunningThreads++;*/<br />
                    }<br />
                }<br />


RUNNING will be true as long as i dont close the port.

I have tryed to changes the serialPort.ReceivedBytesThreshold to all between 1 and 512, but there is not much diffrenc.

If i dont move around some windows and dont get 100% CPU usage, the tranfere file is a perfect match to the one i sent. But if i move around the window so i get 100% CPU usage, then i will lose data in diffrent places?

It simes like that the event will not be fired as is would!?

I have thought of going back to a Thread that goes in a loop and check if there is somthing to read, and if, then it will read it, but this take some performance even if there is no data to be read.

Any sugestions?

BestRegards
SnowJim

PS hope you understand my english
GeneralRe: A tricky priority problem Pin
Snowjim3-Jun-05 13:23
Snowjim3-Jun-05 13:23 
GeneralRe: A tricky priority problem Pin
Carsten Zeumer4-Jun-05 0:46
Carsten Zeumer4-Jun-05 0:46 
GeneralRe: A tricky priority problem Pin
Snowjim4-Jun-05 1:34
Snowjim4-Jun-05 1:34 
GeneralRe: A tricky priority problem Pin
Snowjim4-Jun-05 14:31
Snowjim4-Jun-05 14:31 
GeneralCatching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 13:07
Dmitriy Sinyagin2-Jun-05 13:07 
GeneralRe: Catching the press of the Power Button Pin
Christian Graus2-Jun-05 13:29
protectorChristian Graus2-Jun-05 13:29 
GeneralRe: Catching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 13:59
Dmitriy Sinyagin2-Jun-05 13:59 
GeneralRe: Catching the press of the Power Button Pin
Christian Graus2-Jun-05 14:10
protectorChristian Graus2-Jun-05 14:10 
GeneralRe: Catching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 14:24
Dmitriy Sinyagin2-Jun-05 14:24 
GeneralRe: Catching the press of the Power Button Pin
Christian Graus2-Jun-05 14:28
protectorChristian Graus2-Jun-05 14:28 
GeneralRe: Catching the press of the Power Button Pin
Dmitriy Sinyagin2-Jun-05 14:33
Dmitriy Sinyagin2-Jun-05 14:33 
GeneralTreeView /Spy++/ Handle Pin
Abhishek Karnik2-Jun-05 10:51
Abhishek Karnik2-Jun-05 10:51 
GeneralRe: TreeView /Spy++/ Handle Pin
mav.northwind2-Jun-05 22:13
mav.northwind2-Jun-05 22:13 
GeneralRe: TreeView /Spy++/ Handle Pin
Abhishek Karnik5-Jun-05 10:41
Abhishek Karnik5-Jun-05 10:41 
GeneralC# .NET Remoting problem Pin
Opa Knack2-Jun-05 9:38
Opa Knack2-Jun-05 9:38 
GeneralRe: C# .NET Remoting problem Pin
mav.northwind2-Jun-05 20:29
mav.northwind2-Jun-05 20:29 
GeneralRe: C# .NET Remoting problem Pin
Opa Knack2-Jun-05 21:59
Opa Knack2-Jun-05 21:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.