我正在处理眼动仪。这是监视用户瞳孔的设备。 他们有一个非常基本的示例,在示例代码中,他们以这种方式等待回调:
int is_running = 1000; // in this sample, exit after some iterations
while( --is_running > 0 )
{
error = tobii_wait_for_callbacks( NULL, 1, &device );
assert( error == TOBII_ERROR_NO_ERROR || error == TOBII_ERROR_TIMED_OUT );
error = tobii_device_process_callbacks( device );
assert( error == TOBII_ERROR_NO_ERROR );
}
我需要将其示例代码封装在ATL COM DLL中,并且我想知道只要DLL仍然存在,我想运行该代码该怎么用。 我不想像他们一样使用固定值。
我必须使用无尽的while循环吗?
我来自事件驱动的Visual Basic,而while语句听起来像在执行其他内容时会阻塞其他内容。
here可以检查完整(简短)的C ++代码。
非常感谢您的帮助!