有一启动测量按钮,按下后,二个线程启动
void CTestDlg::OnValueChangedStart(BOOL Value)
{
if(Value)
{
CWinThread* pThread1=AfxBeginThread(Thread1,this,THREAD_PRIORITY_NORMAL);
CWinThread* pThread2=AfxBeginThread(Thread2,this,THREAD_PRIORITY_NORMAL); }
}
定义的线程:
void PASCAL internalTimerProc_V(UINT id,UINT msg,DWORD dwUser,DWORD dw1,DWORD dw2)
{
CTestDlg *cc=(CTestDlg*)AfxGetMainWnd();
cc->SaveFile();
}UINT Thread1(LPVOID) ///保存文件1线程
{
TIMECAPS timecaps;
int TimerResolution;
if (timeGetDevCaps(&timecaps,sizeof(TIMECAPS))==TIMERR_NOERROR)
{
TimerAccuracy=Min(Max(timecaps.wPeriodMin,Accuracy),timecaps.wPeriodMax);
}
timeBeginPeriod(TimerAccuracy);
TimerResolution=10;
TimerID_V =timeSetEvent( TimerResolution,TimerAccuracy,
internalTimerProc_V,1,TIME_PERIODIC);
return 0;
}
void PASCAL internalTimerProc_F(UINT id,UINT msg,DWORD dwUser,DWORD dw1,DWORD dw2)
{
CTestDlg *cc=(CTestDlg*)AfxGetMainWnd();
cc->SaveFile_F();
}
UINT Thread2(LPVOID) ////保存文件2线程
{
TIMECAPS timecaps;
int TimerResolution;
if (timeGetDevCaps(&timecaps,sizeof(TIMECAPS))==TIMERR_NOERROR)
{
TimerAccuracy=Min(Max(timecaps.wPeriodMin,Accuracy),timecaps.wPeriodMax);
}
timeBeginPeriod(TimerAccuracy);
TimerResolution=10;
TimerID_F =timeSetEvent( TimerResolution,TimerAccuracy,
internalTimerProc_F,1,TIME_PERIODIC);
return 0;
}
程序在按下按钮后,不能运行,请问该程序哪个地方不对,该如何修改?谢谢!
void CTestDlg::OnValueChangedStart(BOOL Value)
{
if(Value)
{
CWinThread* pThread1=AfxBeginThread(Thread1,this,THREAD_PRIORITY_NORMAL);
CWinThread* pThread2=AfxBeginThread(Thread2,this,THREAD_PRIORITY_NORMAL); }
}
定义的线程:
void PASCAL internalTimerProc_V(UINT id,UINT msg,DWORD dwUser,DWORD dw1,DWORD dw2)
{
CTestDlg *cc=(CTestDlg*)AfxGetMainWnd();
cc->SaveFile();
}UINT Thread1(LPVOID) ///保存文件1线程
{
TIMECAPS timecaps;
int TimerResolution;
if (timeGetDevCaps(&timecaps,sizeof(TIMECAPS))==TIMERR_NOERROR)
{
TimerAccuracy=Min(Max(timecaps.wPeriodMin,Accuracy),timecaps.wPeriodMax);
}
timeBeginPeriod(TimerAccuracy);
TimerResolution=10;
TimerID_V =timeSetEvent( TimerResolution,TimerAccuracy,
internalTimerProc_V,1,TIME_PERIODIC);
return 0;
}
void PASCAL internalTimerProc_F(UINT id,UINT msg,DWORD dwUser,DWORD dw1,DWORD dw2)
{
CTestDlg *cc=(CTestDlg*)AfxGetMainWnd();
cc->SaveFile_F();
}
UINT Thread2(LPVOID) ////保存文件2线程
{
TIMECAPS timecaps;
int TimerResolution;
if (timeGetDevCaps(&timecaps,sizeof(TIMECAPS))==TIMERR_NOERROR)
{
TimerAccuracy=Min(Max(timecaps.wPeriodMin,Accuracy),timecaps.wPeriodMax);
}
timeBeginPeriod(TimerAccuracy);
TimerResolution=10;
TimerID_F =timeSetEvent( TimerResolution,TimerAccuracy,
internalTimerProc_F,1,TIME_PERIODIC);
return 0;
}
程序在按下按钮后,不能运行,请问该程序哪个地方不对,该如何修改?谢谢!
您想非常省事的写 C++ 程序文档吗?
DocWizard 略作小改动,版本号 1.0.0.2 欢迎使用欢迎下载,提出改进建议 http://www.betajin.com/alphasun/index.htm
您在写文档时是否被数量众多的类成员函数所烦恼?是否为了美观的
版面、格式而困扰?是否为了做成CHM而不得不进行大量的手工操作?
本软件可以帮助您 ● 生成C++的类的HTML格式的文档,条分缕析,版面美观而朴实。
并且可以集成到 HTML Workshop 中,和其他类一起形成CHM。 ● 而且可以生成 content of topic (.hhc) 文件以及生成
index (.hhk) 文件。避免您手工编辑生成文件的麻烦。要知
道在 HTML Workshop 中编辑生成这两种文件是非常麻烦的。 ● 在马上就要推出的新版本中,将提供二次开发接口,您将可以
操纵文档生成过程,形成更符合您要求的文档。当然源代码的
解析本软件已经帮您完成了,您所要做的仅仅是生成您所关心
的“部分”文档。欢迎下载,提出改进建议 http://www.betajin.com/alphasun/index.htm