Click here to Skip to main content
15,903,030 members
Home / Discussions / C#
   

C#

 
AnswerRe: audio sound suite for .net crack Pin
Nish Nishant10-Mar-10 1:57
sitebuilderNish Nishant10-Mar-10 1:57 
AnswerRe: audio sound suite for .net crack PinPopular
Seve6510-Mar-10 2:06
Seve6510-Mar-10 2:06 
GeneralRe: audio sound suite for .net crack Pin
The Man from U.N.C.L.E.10-Mar-10 7:16
The Man from U.N.C.L.E.10-Mar-10 7:16 
GeneralRe: audio sound suite for .net crack Pin
Seve6510-Mar-10 8:07
Seve6510-Mar-10 8:07 
QuestionProblem with Padding space around the label. Pin
Bojja Lakshmi9-Mar-10 22:18
Bojja Lakshmi9-Mar-10 22:18 
QuestionSerialPort.ReadTimeout issue Pin
yeah10009-Mar-10 22:08
yeah10009-Mar-10 22:08 
AnswerRe: SerialPort.ReadTimeout issue Pin
Rashmi_Karnam9-Mar-10 23:35
Rashmi_Karnam9-Mar-10 23:35 
AnswerRe: SerialPort.ReadTimeout issue [modified] Pin
CDP180210-Mar-10 1:10
CDP180210-Mar-10 1:10 
Try to look at it differently. Why don't you simply buffer the bytes yourself.

1) Read serial bytes and add them to your buffer
2) if you have the required amount of bytes or more in your buffer, remove the number you expect and process them (leaving those which are not yet processed in the buffer)
3) back to step 1

This is obviously a polling loop. If you have a WinForms user interface, this loop will lock it up. Therefore you would have to run this loop in a separate worker thread. And it might be a good idea, not to let this thread run under full steam. I don't know what timing interval might be sufficient for your application.

Let's just say you want the loop check for new serial bytes once every second, determining a suitable timing value is up to you. You would then have to add the line

Thread.Sleep(1000);

This excludes the thread from getting any processor time for 1000 milliseconds(= one second). This way your application will use the CPU more economically.

Edit: I just saw that someone had the same idea before me
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.

I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
modified on Wednesday, March 10, 2010 7:20 AM

GeneralRe: SerialPort.ReadTimeout issue Pin
mmdullah31-Mar-10 1:14
mmdullah31-Mar-10 1:14 
GeneralRe: SerialPort.ReadTimeout issue Pin
CDP180231-Mar-10 2:01
CDP180231-Mar-10 2:01 
AnswerRe: SerialPort.ReadTimeout issue Pin
PIEBALDconsult10-Mar-10 3:04
mvePIEBALDconsult10-Mar-10 3:04 
Questionlaunching a windows app from windows service.... Pin
Ihtesham9-Mar-10 21:55
Ihtesham9-Mar-10 21:55 
AnswerRe: launching a windows app from windows service.... Pin
Calla9-Mar-10 22:25
Calla9-Mar-10 22:25 
GeneralRe: launching a windows app from windows service.... Pin
Ihtesham9-Mar-10 23:49
Ihtesham9-Mar-10 23:49 
GeneralRe: launching a windows app from windows service.... Pin
Calla10-Mar-10 0:06
Calla10-Mar-10 0:06 
GeneralRe: launching a windows app from windows service.... Pin
#realJSOP10-Mar-10 0:11
professional#realJSOP10-Mar-10 0:11 
GeneralRe: launching a windows app from windows service.... Pin
Ihtesham10-Mar-10 1:31
Ihtesham10-Mar-10 1:31 
GeneralRe: launching a windows app from windows service.... Pin
#realJSOP10-Mar-10 1:48
professional#realJSOP10-Mar-10 1:48 
GeneralRe: launching a windows app from windows service.... Pin
Ihtesham10-Mar-10 2:38
Ihtesham10-Mar-10 2:38 
GeneralRe: launching a windows app from windows service.... Pin
Calla10-Mar-10 3:03
Calla10-Mar-10 3:03 
GeneralRe: launching a windows app from windows service.... Pin
#realJSOP10-Mar-10 11:39
professional#realJSOP10-Mar-10 11:39 
QuestionAre pathgradient brushes slow? Pin
VCsamir9-Mar-10 19:22
VCsamir9-Mar-10 19:22 
AnswerRe: Are pathgradient brushes slow? Pin
CDP180210-Mar-10 1:35
CDP180210-Mar-10 1:35 
AnswerRe: Are pathgradient brushes slow? Pin
Saksida Bojan10-Mar-10 6:00
Saksida Bojan10-Mar-10 6:00 
QuestionVehicle Recognition System Pin
jokerleo9-Mar-10 19:11
jokerleo9-Mar-10 19:11 

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.