Click here to Skip to main content
15,914,452 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: I'd be happier coding... Pin
Marc Clifton2-Apr-14 5:22
mvaMarc Clifton2-Apr-14 5:22 
GeneralRe: I'd be happier coding... Pin
CBadger2-Apr-14 23:58
professionalCBadger2-Apr-14 23:58 
GeneralWell my struggle continues... Pin
glennPattonWork32-Apr-14 2:23
professionalglennPattonWork32-Apr-14 2:23 
GeneralRe: Well my struggle continues... Pin
OriginalGriff2-Apr-14 2:32
mveOriginalGriff2-Apr-14 2:32 
GeneralRe: Well my struggle continues... Pin
glennPattonWork32-Apr-14 2:47
professionalglennPattonWork32-Apr-14 2:47 
GeneralRe: Well my struggle continues... Pin
Nagy Vilmos2-Apr-14 3:00
professionalNagy Vilmos2-Apr-14 3:00 
GeneralRe: Well my struggle continues... Pin
glennPattonWork32-Apr-14 3:09
professionalglennPattonWork32-Apr-14 3:09 
GeneralRe: Well my struggle continues... Pin
OriginalGriff2-Apr-14 3:24
mveOriginalGriff2-Apr-14 3:24 
It does - DoEvents empties the message queue and dispatches messages, and almost every .NET application uses it, but it's "hidden": ShowDialog calls it to allow the dialog to be modal and the "parent" form to continue to update. It's there, but it can cause some horrible, horrible problems if it isn't used carefully - so the "blank ban" on using it is the same as for goto - it should have "until you know what you are doing, a couple of years experience should do it". I haven't used DoEvents for twenty years... Laugh | :laugh:

Thread.Sleep is different: it takes the current thread and stops it doing anything until the time is up. So if you call that on the UI thread...the interface stops updating, and the user thinks your app has crashed. So generally it's a poor idea. But...if you are doing something on a non-UI thread then it is a good idea, and more efficient than a timer. Did you know that the SerialPort.DataRecieved event is never executed on the UI thread? So any code that is handling this data can safely call Thread.Sleep without any problems if it has to "wait" for an external device to "catch up" and be ready for new commands. It's a PITA, yes - but sometimes we have to work with awkward hardware...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

GeneralRe: Well my struggle continues... Pin
Nagy Vilmos2-Apr-14 3:28
professionalNagy Vilmos2-Apr-14 3:28 
GeneralRe: Well my struggle continues... Pin
glennPattonWork32-Apr-14 3:31
professionalglennPattonWork32-Apr-14 3:31 
GeneralRe: Well my struggle continues... Pin
Pualee2-Apr-14 3:24
Pualee2-Apr-14 3:24 
GeneralRe: Well my struggle continues... Pin
BobJanova2-Apr-14 3:41
BobJanova2-Apr-14 3:41 
GeneralRe: Well my struggle continues... Pin
Rage2-Apr-14 3:41
professionalRage2-Apr-14 3:41 
GeneralA Windows 8 surprise Pin
MT_2-Apr-14 2:11
professionalMT_2-Apr-14 2:11 
JokeRe: A Windows 8 surprise Pin
Kornfeld Eliyahu Peter2-Apr-14 2:16
professionalKornfeld Eliyahu Peter2-Apr-14 2:16 
GeneralRe: A Windows 8 surprise Pin
Richard Deeming2-Apr-14 2:38
mveRichard Deeming2-Apr-14 2:38 
GeneralRe: A Windows 8 surprise Pin
Blue Waffle2-Apr-14 3:03
Blue Waffle2-Apr-14 3:03 
GeneralRe: A Windows 8 surprise Pin
MT_2-Apr-14 3:06
professionalMT_2-Apr-14 3:06 
GeneralRe: A Windows 8 surprise Pin
Paulo Augusto Kunzel2-Apr-14 4:31
professionalPaulo Augusto Kunzel2-Apr-14 4:31 
GeneralRe: A Windows 8 surprise Pin
dandy722-Apr-14 6:42
dandy722-Apr-14 6:42 
GeneralContributing to the demise of software development Pin
Rob Philpott2-Apr-14 2:07
Rob Philpott2-Apr-14 2:07 
GeneralRe: Contributing to the demise of software development Pin
Dave Kreskowiak2-Apr-14 2:18
mveDave Kreskowiak2-Apr-14 2:18 
GeneralRe: Contributing to the demise of software development Pin
OriginalGriff2-Apr-14 2:29
mveOriginalGriff2-Apr-14 2:29 
GeneralRe: Contributing to the demise of software development Pin
Rob Philpott2-Apr-14 3:00
Rob Philpott2-Apr-14 3:00 
GeneralRe: Contributing to the demise of software development Pin
OriginalGriff2-Apr-14 3:27
mveOriginalGriff2-Apr-14 3:27 

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.