赵老师,这个代码不知哪里出错了,太长了发不了给您啦,在这看吧

张珞娅 2015-01-05 10:55:35
if (nIDEvent == ID_TIMER1)
{
m_uSpendTime++;
InvalidateRect(&rcTime,FALSE);
if (m_uSpendTime == 5)
{
KillTimer(nIDEvent);
AfxMessageBox("时间到!",MB_OK);
ReleaseCapture();
return;
}
}
if(nIDEvent == ID_TIMER2)
{
m_uSpendTime++;
InvalidateRect(&rcTime,FALSE);
if (m_uSpendTime== 10)
{
KillTimer(nIDEvent);
AfxMessageBox("时间到!",MB_OK);
ReleaseCapture();
return;
}
}
if(nIDEvent == ID_TIMER3)
{
m_uSpendTime++;
InvalidateRect(&rcTime,FALSE);
if (m_uSpendTime == 15)
{
KillTimer(nIDEvent);
AfxMessageBox("时间到!",MB_OK);
ReleaseCapture();
return;
}
}
...全文
217 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2015-01-07
  • 打赏
  • 举报
回复
里程碑之间的距离越短,成就感越强。
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
要学会 编辑、查找和替换、查找范围:整个解决方案、查找全部 功能。
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
你要在 SetTimer时分别指定 ID_TIMER1, ID_TIMER2, ID_TIMER3 在相应头文件中分别#define ID_TIMER1, ID_TIMER2, ID_TIMER3
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
加尽量多的TRACE宏辅助调试。 TRACE TRACE( exp ) Parameters exp Specifies a variable number of arguments that are used in exactly the same way that a variable number of arguments are used in the run-time function printf. Remarks Provides similar functionality to the printf function by sending a formatted string to a dump device such as a file or debug monitor. Like printf for C programs under MS-DOS, the TRACE macro is a convenient way to track the value of variables as your program executes. In the Debug environment, the TRACE macro output goes to afxDump. In the Release environment, it does nothing. TRACE is limited to sending a total of 512 characters at a time. If you call TRACE with formatting commands, the total string length after the formatting commands have been expanded cannot be more than 512 characters, including the terminating NULL. Exceeding this limit causes an ASSERT. Note This macro is available only in the debug version of MFC. For more information, seeMFC Debugging Support in Visual C++ Programmer’s Guide. Example // example for TRACE int i = 1; char sz[] = "one"; TRACE( "Integer = %d, String = %s\n", i, sz ); // Output: 'Integer = 1, String = one' See Also TRACE0, TRACE1, TRACE2, TRACE3, AfxDump, afxTraceEnabled
张珞娅 2015-01-06
  • 打赏
  • 举报
回复
重要弄好三个定时器了,哈哈。。。。。接下来就是如何分别为初级、中级、高级调用这三定时器啦
张珞娅 2015-01-06
  • 打赏
  • 举报
回复
老师,您和我学校教授解决这问题的方法一样,果然英雄所见略同啊。下面是解决方法吗?
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
CWindow::SetTimer UINT SetTimer( UINT nIDEvent, UINT nElapse ) SeeSetTimer in the Win32 SDK. Remarks Creates a timer event. CWindow Overview | Class Members See Also CWindow::KillTimer
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译,直到定位到具体语法出错的位置。” 的方法解决的。
张珞娅 2015-01-06
  • 打赏
  • 举报
回复
F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(437) : error C2059: syntax error : ')' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(438) : error C2143: syntax error : missing ';' before '{' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(449) : error C2059: syntax error : ')' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(450) : error C2143: syntax error : missing ';' before '{' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(461) : error C2059: syntax error : ')' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(462) : error C2143: syntax error : missing ';' before '{' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1690) : error C2143: syntax error : missing ')' before ',' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1690) : error C2660: 'SetTimer' : function does not take 0 parameters F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1690) : error C2059: syntax error : ')' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1691) : error C2143: syntax error : missing ')' before ',' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1691) : error C2660: 'SetTimer' : function does not take 0 parameters F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1691) : error C2059: syntax error : ')' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1692) : error C2143: syntax error : missing ')' before ',' F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1692) : error C2660: 'SetTimer' : function does not take 0 parameters F:\947117784\FileRecv\过程\Mine\MineWnd.cpp(1692) : error C2059: syntax error : ')'
赵4老师 2015-01-06
  • 打赏
  • 举报
回复
引用 4 楼 nizhenshidashen 的回复:
我都定义好了,就是这里程序符号出错之类的,很多问题
将编译出错信息拷贝粘贴上来。
张珞娅 2015-01-06
  • 打赏
  • 举报
回复
我都定义好了,就是这里程序符号出错之类的,很多问题

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧