为何回调函数不执行??
为何回调函数不执行??
我在类的构造函数里写
uTSystemFun1()
{
TIMERPROC pTime = (TIMERPROC)OnTime;
SetSavePointType();
// create control for timer
m_hWnd = ::CreateWindow("static", "", 0, 0, 0, 0, 0, NULL, NULL, 0, NULL);
::SetWindowLong(m_hWnd , GWL_USERDATA , (long)(this) );
SetTimer(m_hWnd,1,1000,pTime);
}
回调函数为:
static void OnTime()//.HWND h,UINT u1,UINT u2,DWORD d)
{if (CpuTime == MaxSavePoint)
{
CpuUsagePos();
CpuTime=CpuTime-1;
}
CpuUsageSun.TSavePoint[CpuTime]=CpuTime;
CpuTime=CpuTime+1;
}
在main()里:uTSystemFun1 *sys = new uTSystemFun1;
可为何OnTime()一直不执行啊 ??