I've a closed-source .net system library which is a wrapper class around a
native system dll. This .net library contains of one class with serveral
public static methods for playing the buzzer, setting cpu speed,
enabling/disabling the keypad and so on. Calling functions of this library
inside control's event handlers (like OnLoad, OnGotFoucs, ...) sometimes
causes problems. Deeper investigations (using the ildasm tool) revealed,
that each and every library method calls the Application.DoEvents() method
just before returning to the caller.

Has someone an assumption why calling Application.DoEvents() inside
control's event handler causes problems? Could there be a problem with the
order the windows messages are processed?

Greetings, Christian

RE: Application.DoEvents() inside control's event handler? by a-et

a-et
Tue Oct 05 18:32:36 CDT 2004

Hi Christian,

Application.DoEvents let's message handler process other window messages.
Is your application or library thread safe?

Thanks

Ercan