作者vocaloid (vocaloid)
看板C_and_CPP
標題Re: [問題] 十分鐘結束的程式???
時間Tue Feb 3 15:23:49 2009
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