I’m trying to do it like I found in some example :
TimerID = gcnew System::Windows::Forms::Timer();
TimerID->Tick += gcnew System::EventHandler(this, &Bridge::timer1_Tick);
and
System::Void Bridge::timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
Bridge::DoUpdate();
}
But can’t create event handler because of error :
error C3364: ‘System::EventHandler’ : invalid argument for delegate
constructor; delegate target needs to be a pointer to a member
function
Bridge is unmanaged class.
So I’m declaring TimerID this way :
gcroot<System::Windows::Forms::Timer ^> TimerID;
What am I doing wrong here ? How to add Tick event proper ?
You didn’t post enough code to diagnose the error. This compiles: