Jaws's picture

how to use the Application.Idle in windows forms application??

Hello guys:

because the Application.Idle in C# is ok, but how to use it in the windows forms application.

look at the code:

Application::Idle+=gcnew EventHandler(Application1_Idle);

and the error

1>c:\users\bureautique\documents\visual studio 2010\projects\otk\otk\Form1.h(135): error C3867: &'OTK::Form1::Application1_Idle' : liste d'arguments manquante dans l'appel de fonction ; utilisez 'OTK::Form1::Application1_Idle' pour créer un pointeur vers membre

can anyone give me a hand?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

I'm not very familiar with C++/CLI, but I *think* you need to pass the instance of the class explicitly when creating a delegate (unlike C#). Assuming your class is named "Form1" and you are hooking Application::Idle from inside that class, you'd need something like:

Application::Idle += gcnew EventHandler(this, &Form1::Application1_Idle);