請問assert問題? |
答題得分者是:mephise
|
mitchellhu
一般會員 發表:23 回覆:53 積分:15 註冊:2007-06-12 發送簡訊給我 |
今日為了multithread問題,google一篇不錯的文章http://www.midnightbeach.com/jon/pubs/MsgWaits/MsgWaits.html
並附有範例,但在範例中有一段程式如下: constructor TStopStartThread.Create; begin Event := CreateEvent(Nil, True, False, Nil); // API call is smaller and simpler than Delphi wrapper Assert(Event <> null); Waiting := False; Aborted := False; inherited Create(True); // Create a suspended thread end; 其中Assert(Envent<> null);此行編譯報錯:[DCC Error] SynchedThreads.pas(200): E2003 Undeclared identifier: 'null' Event 是一個handle, Assert(Envent<> null) 這行的用意 應該是要確保 Event 確實存在,如非時會觸發assert的系統報錯通知吧 我實在想不出來這句有什麼地方錯了 為什麼 null會被判成Undeclared identifier? 請大大指引迷津 感恩 編輯記錄
|
mephise
高階會員 發表:4 回覆:149 積分:205 註冊:2004-02-09 發送簡訊給我 |
|
mitchellhu
一般會員 發表:23 回覆:53 積分:15 註冊:2007-06-12 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |