我在dialog中放了一个按钮,在点击按钮的同时打开另一个进程,如果打开成功,则开启定时器,但是现在是打开进程成功了,但是定时器就是不跑道他的响应函数中,为什么啊?
void CTDlg::OnBtnset()
{
CString str;
str = m_szCurrentPath + "Reset.exe";
m_hPass = RunProcess(str);
if(m_hPass!= NULL)
{ GetDlgItem(IDC_BTN_RESET)->EnableWindow(FALSE);
if(m_bThreadActive == FALSE)
{
m_bThreadActive = TRUE;
SetTimer(1, 100, NULL);
}
}
}void CTDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
AfxMessageBox("OK!");
CDialog::OnTimer(nIDEvent);
}
void CTDlg::OnBtnset()
{
CString str;
str = m_szCurrentPath + "Reset.exe";
m_hPass = RunProcess(str);
if(m_hPass!= NULL)
{ GetDlgItem(IDC_BTN_RESET)->EnableWindow(FALSE);
if(m_bThreadActive == FALSE)
{
m_bThreadActive = TRUE;
SetTimer(1, 100, NULL);
}
}
}void CTDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
AfxMessageBox("OK!");
CDialog::OnTimer(nIDEvent);
}
解决方案 »
- 求代码优化,附上源码
- ado连接oracle问题
- 为什么我的程序一直在跑WM_SIZE消息
- 怎么让一个COM组件在IE里显示为透明的?
- --->>100分,如何创建不存在的文件夹
- 在线等待,急,,请问,在VC中如何自动配置ODBC数据源(我的数据库用Oracle)?
- 到底是什么问题,我头发都白了
- 哪里能免费下载电影呀?
- 急!急!(在线等待)在VC中怎么使用Microsoft Form 2.0 TextBox 控件,我想向TextBox中写字,却写不进去!???为什么???
- java 调用cml执行bat文件之后,窗口还在,但是进程怎么关啊?
- vc 和 java 怎样通信?
- 怎样将RGB值转换成YMC的值? YMC即: Yellow,Magenta,Cyan的缩写。
SetTimer(1, ...
换称
SetTimer(8888, ...
试试,
看看是不是和他们的定义重合了
there is bugs for timer in the skin procedure
Thank you every body!