Re: [問題] 十分鐘結束的程式???

看板C_and_CPP作者 (vocaloid)時間15年前 (2009/02/03 15:23), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/6 (看更多)
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
文章代碼(AID): #19X_46TV (C_and_CPP)
討論串 (同標題文章)
文章代碼(AID): #19X_46TV (C_and_CPP)