想在一个非窗口类中实现一个定时程序,但MFC定时器只支持窗口类中使用,请问怎么在一个非窗口类中实现定时器的功能呢,在网上搜到一篇文章,但那都是通过窗口类去掉用的,相当于只是把MFC的定时器重新封装了一下。所以大家可以把我这里说的窗口类理角为控制台程序吧!先谢了!
解决方案 »
- 用vs2008编译成的dll在xp上调用会出现应用程序初始化失败
- 请问一下,用CShockwaveFlash的create()失败,提示是getlasterror() = 126
- dll与hook问题,来帮忙啊,快来看看啊,大虾们,求助啊
- 关于获取ocx返回值的问题?
- 如何在主对话框中导航URL
- 请问怎样使工具栏不那么立体```就是平坦一点``但仍然有点点立体感``
- 新手问:在VC中如何将一个文件存入数据库中,sqlserver2000数据库,最好提供原码。
- 关于DirectDraw的,分数多多,进来便知。
- error C1010: unexpected end of file while looking for precompi
- 大家能帮我理解理解这句话的意思么?
- 能不能在try-catch里产生Dump文件
- 读取固定格式的文本文件?
不过我这里是用_sleep(int x)不知道是不是版本的原因
This function creates a timer with the specified time-out value. UINT SetTimer(
HWND hWnd,
UINT nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc );
Parameters
hWnd
Handle to the window to be associated with the timer. This window must be owned by the calling thread. If this parameter is NULL, no window is associated with the timer and the nIDEvent parameter is ignored. nIDEvent
Specifies a nonzero timer identifier. If the hWnd parameter is NULL, this parameter is ignored.
uElapse
Specifies the time-out value, in milliseconds.
lpTimerFunc
Long pointer to the function to be notified when the time-out value elapses. For more information about the function, see TimerProc.
If lpTimerFunc is NULL, the system posts a WM_TIMER message to the application queue. The hwnd member of the message’s MSG structure contains the value of the hWnd parameter.