First of all, you should note that accuracy is not the same as precision[^]. 10ms is pretty much the most accurate you can get with Win32, without screwing with the operating system metrics or reinstalling the HAL. But anyway, you use timeSetEvent in C++/CLI the same way you use it in Win32.
#include #pragma comment(lib, "winmm")
public ref class TimerWrapper
{
EventHandle ^eventHandle;
public:
TimerWrapper()
: eventHandle(false, EventResetMode::AutoReset)
{
}
int TimerFunc()
{
for( ; ; )
{
eventHandle->WaitOne();
...
}
}
void UseTimeEvent()
{
timeSetEvent(100, 55, reinterpret_cast(
eventHandle->SafeWaitHandle->DangerousWaitHandle().ToPointer()),
0, TIME_ONESHOT | TIME_CALLBACK_EVENT_SET);
...
}
};
-- modified at 17:31 Saturday 13th May, 2006