我正在尝试学习如何使用 C++ .net 计时器。在此处给出的示例中:
http://msdn.microsoft.com/en-us/library/system.timers.timer.elapsed.aspx
在它说的代码中:
// Hook up the Elapsed event for the timer.
aTimer->Elapsed += gcnew ElapsedEventHandler( Timer1::OnTimedEvent );
似乎 += 已重载。在这种情况下是什么意思?
我也不明白为什么在链接中的示例中,计时器重复启动和停止,如其输出所示:
The Elapsed event was raised at 5/20/2007 8:42:27 PM
The Elapsed event was raised at 5/20/2007 8:42:29 PM
The Elapsed event was raised at 5/20/2007 8:42:31 PM
据我了解,它应该只启动和停止一次。