⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_24023.htm

📁 一些关于vc的问答
💻 HTM
字号:
<p>
序号:24023 发表者:atang 发表日期:2002-12-09 00:08:29
<br>主题:急死了,如何在一个对话框上用定时器啊!!!!
<br>内容:创建一个对话框,并做为程序的主窗口,想在里面用定时器实现一些动画.可是出现问题:<BR>程序如下:<BR>BOOL CBoidApp::InitInstance()<BR>{<BR>&nbsp;&nbsp;&nbsp;&nbsp;//...<BR>&nbsp;&nbsp;&nbsp;&nbsp;CBoidDlg dlg;<BR>&nbsp;&nbsp;&nbsp;&nbsp;this-&gt;m_pMainWnd = &amp;dlg;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dlg.SetTimer(10,50,NULL);//这个地方错了,但不知如何改.<BR>&nbsp;&nbsp;&nbsp;&nbsp;int nResponse = dlg.DoModal();<BR>&nbsp;&nbsp;&nbsp;&nbsp;//...<BR>}<BR><BR>build时通过,可是Go时出现"assert"错误,<BR><BR>_AFXWIN_INLINE UINT CWnd::SetTimer(UINT nIDEvent, UINT nElapse,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void (CALLBACK* lpfnTimer)(HWND, UINT, UINT, DWORD))<BR>&nbsp;&nbsp;&nbsp;&nbsp;{ ASSERT(::IsWindow(m_hWnd)); return ::SetTimer(m_hWnd, nIDEvent, nElapse,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(TIMERPROC)lpfnTimer); }<BR>
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:不说 回复日期:2002-12-09 00:21:49
<br>内容:那是当然的啦……DoModal之前这个窗口对象还没建立呢,timer事件发给谁啊?呵呵……<BR>你在CBoidDlg里虫灾WM_INITIALDLG(好象叫这个名字)的消息处理函数,在那里SetTimer好了。<BR><BR>另外,最好给你的timer起个名字,别弄个10就摆那里了哈,这年头不时兴裸奔了哈
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:atang 回复日期:2002-12-09 01:47:41
<br>内容:........:((((汗<BR>thanks you anyway!<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -