是否能够在OnTimer()内重新设定定时器的时间,我该如何做?
解决方案 »
- 怎样浏览并取得某个目录的路径而不需要指定打开某个文件?
- 求助:应该是多态的问题……
- 就不信没人不会这个问题,进来看下
- vc6与vc.net的一点不同
- 添加字段问题:用:alter table SCOTT.密码备份表 add 密码5 varchar(10) 的问题
- !!一个小问题,各位大侠,你们能帮小弟一把吗?
- 菜鸟问题,如何在98下面注册COM组件。
- 我已经在一个.exe的菜单资源中增加了一个ID,怎样在里面加入自己的功能?
- 一个初级的问题
- 想做这样一个功能!怎么做
- 为什么出现如下错误:unresolved external symbol __imp__listen@8
- 有没有一个界面显示多幅图象的例子?
SetTimer(1,1000,NULL);
OnTimer()
{
//达到条件就设成0.5秒一次
if(...)
SetTimer(1,500,NULL);
}
正确的应该是:
本来你是1秒一次
SetTimer(1,1000,NULL);
OnTimer()
{
//达到条件就设成0.5秒一次
if(...)
{
KillTimer(1)
SetTimer(1,500,NULL);
}
}
SetTimer();
就可以了。
Applications create timers by using the SetTimer function. A new timer starts timing the interval as soon as it is created. An application can change a timer's time-out value by using SetTimer and can destroy a timer by using the KillTimer function. To use system resources efficiently, applications should destroy timers that are no longer necessary.