MFC定时器 [英] MFC TIMER

查看:92
本文介绍了MFC定时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果多次调用SetTimer会发生什么。任何资源泄漏? 

What will happen if SetTimer is called multiple times. Any resource leak? 

    id = SetTimer(1,250,NULL);

   id = SetTimer(1, 250, NULL);

    id = SetTimer(1,250,NULL);

   id = SetTimer(1, 250, NULL);

推荐答案

由于CWnd :: SetTimer最终调用
SetTimer
,然后将适用该文档。

Since CWnd::SetTimer ends up calling SetTimer, then the documentation for that would apply.

正如它所述,如果您使用相同的事件ID,那么它只是用旧的计时器替换旧计时器并重置计时器。

As it states, if you use the same event id, then it just replaces the old timer with a new one and resets the timer.


这篇关于MFC定时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆