Re: [問題] 十分鐘結束的程式???
http://tinyurl.com/ct5vsr
※ 引述《james732 (好人超)》之銘言:
: 剛剛寫了一個小程式:
: #include <windows.h>
: #include <iostream>
:
: using namespace std;
:
: int main()
: {
: int stopflag = 0;
MSG ggc;
: cout << SetTimer(NULL, 0, 100, (TIMERPROC)NULL) << endl;
: while (!stopflag)
: {
while (GetMessage(&ggc, NULL, 0, 0)
{
if (ggc.message == WM_TIMER) {
stopflag = 1;
break;
}
// TranslateMessage(&ggc);
// DispatchMessage(&ggc);
}
: }
:
: cout << "ya" << endl;
:
: return 0;
: }
: 印出 SetTimer 的回傳值並不是 0,應該是成功了
: 但是卻一直等不到函式執行。
: 請問,它的問題出在哪裡呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.59.0.65
討論串 (同標題文章)
完整討論串 (本文為第 5 之 6 篇):
問題
3
6