Application.DoEvents() inside control's event handler?

  • Thread starter Thread starter Christian Schwarz
  • Start date Start date
C

Christian Schwarz

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
 
Hi Christian,

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

Thanks

Ercan
 
Back
Top