Click here to Skip to main content
15,911,890 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Odd problem with UDPClient Pin
Luc Pattyn9-Sep-10 10:59
sitebuilderLuc Pattyn9-Sep-10 10:59 
GeneralRe: Odd problem with UDPClient Pin
Peter R. Fletcher13-Sep-10 4:51
Peter R. Fletcher13-Sep-10 4:51 
QuestionAdding different contorl( combox, textbox) in a single coloumn of datagirdview (window) Pin
shahabsuhail7-Sep-10 22:56
shahabsuhail7-Sep-10 22:56 
AnswerRe: Adding different contorl( combox, textbox) in a single coloumn of datagirdview (window) Pin
Dave Kreskowiak8-Sep-10 4:18
mveDave Kreskowiak8-Sep-10 4:18 
Questionapplication path Pin
Jefry boycot7-Sep-10 4:59
Jefry boycot7-Sep-10 4:59 
AnswerRe: application path Pin
The Man from U.N.C.L.E.7-Sep-10 6:34
The Man from U.N.C.L.E.7-Sep-10 6:34 
AnswerRe: application path Pin
RaviRanjanKr15-Dec-10 5:25
professionalRaviRanjanKr15-Dec-10 5:25 
QuestionHow does Application.DoEvents work? Pin
MicroVirus7-Sep-10 2:44
MicroVirus7-Sep-10 2:44 
Hello coders,

I've been wondering this for some time, but haven't been able to find an answer to: How does DoEvents actually work (technically seen)?
The way I look at it, you have this picture describing your single-threaded application:
[ Your code ]
[ Translation to .NET events ]
[ Message Pump ]

With basically messages coming in from Windows at the Message Pump level, then advancing up until it reaches your code in terms of Events. Your code runs etcetera, and whenever execution 'pauses' (e.g. disappears when debugging), the message pump gets execution again and handles messages. Somewhere parallel is the garbage collector, asynchronously cleaning up your mess in collect 'n reap batches. Am I at least right about this picture (if not, then my question might not make sense)?
The actual question then is: how does DoEvents, called from your code, manage to fall back into the Message Pump? I'd think you need to re-enter the calling function, so basically advance through the stack back to the caller, without losing all the context allowing you to move up to your original point of execution. That means that a simple call to the message pump 'function' would not be the way to, because then it would end up a top of the stack.
One solution to this I was thinking of was to use something like SendMessage(WM_USER_IDLE, ...) to get back into the message pump, but is that even possible/allowed? Does anyone know the answer, because I am REALLY curious Smile | :)

Thanks for reading my rant, and I'll hope you have some answers,
Richard
AnswerRe: How does Application.DoEvents work? Pin
Luc Pattyn7-Sep-10 3:17
sitebuilderLuc Pattyn7-Sep-10 3:17 
GeneralRe: How does Application.DoEvents work? Pin
MicroVirus7-Sep-10 9:25
MicroVirus7-Sep-10 9:25 
AnswerRe: How does Application.DoEvents work? Pin
Johann Gerell8-Sep-10 2:41
Johann Gerell8-Sep-10 2:41 
GeneralRe: How does Application.DoEvents work? Pin
Luc Pattyn8-Sep-10 2:45
sitebuilderLuc Pattyn8-Sep-10 2:45 
GeneralRe: How does Application.DoEvents work? Pin
Spectre_0018-Sep-10 4:18
Spectre_0018-Sep-10 4:18 
GeneralRe: How does Application.DoEvents work? Pin
Luc Pattyn8-Sep-10 4:30
sitebuilderLuc Pattyn8-Sep-10 4:30 
AnswerRe: How does Application.DoEvents work? Pin
Guy Harwood8-Sep-10 2:05
Guy Harwood8-Sep-10 2:05 
GeneralRe: How does Application.DoEvents work? Pin
Mike Devenney8-Sep-10 2:49
Mike Devenney8-Sep-10 2:49 
AnswerRe: How does Application.DoEvents work? Pin
Patrick Fox8-Sep-10 5:41
Patrick Fox8-Sep-10 5:41 
AnswerRe: How does Application.DoEvents work? Pin
Fabio Franco8-Sep-10 6:15
professionalFabio Franco8-Sep-10 6:15 
GeneralRe: How does Application.DoEvents work? [modified] Pin
the Kris8-Sep-10 8:29
the Kris8-Sep-10 8:29 
GeneralRe: How does Application.DoEvents work? Pin
Fabio Franco8-Sep-10 8:38
professionalFabio Franco8-Sep-10 8:38 
AnswerRe: How does Application.DoEvents work? Pin
englebart8-Sep-10 8:46
professionalenglebart8-Sep-10 8:46 
AnswerRe: How does Application.DoEvents work? Pin
Scott Barbour8-Sep-10 10:08
Scott Barbour8-Sep-10 10:08 
GeneralRe: How does Application.DoEvents work? Pin
MicroVirus10-Sep-10 12:41
MicroVirus10-Sep-10 12:41 
QuestionCalendarExtender popup appearing when Enter key is pressed Pin
dev_asp_shreshtha6-Sep-10 1:09
dev_asp_shreshtha6-Sep-10 1:09 
AnswerRe: CalendarExtender popup appearing when Enter key is pressed Pin
Pete O'Hanlon6-Sep-10 1:30
mvePete O'Hanlon6-Sep-10 1:30 

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.