Release與Free的差別 |
答題得分者是:whyzn
|
m0210
一般會員 發表:31 回覆:29 積分:17 註冊:2002-08-23 發送簡訊給我 |
|
whyzn
中階會員 發表:46 回覆:149 積分:54 註冊:2002-06-16 發送簡訊給我 |
貼一段 OnLine Help 您參考一下 Use Release to destroy the form and free its associated memory. Release is much like the Free method except that Release does not destroy the form until all event handlers of the form and event handlers of components on the form have finished executing. Any event handlers of the form should use Release instead of Free. Failing to do so could lead to an access violation. ●○○○○○●○○○○○●
竹密不妨水過,山高無礙雲飛
------
●○○○○○●○○○○○● 竹密不妨水過,山高無礙雲飛 |
m0210
一般會員 發表:31 回覆:29 積分:17 註冊:2002-08-23 發送簡訊給我 |
|
whyzn
中階會員 發表:46 回覆:149 積分:54 註冊:2002-06-16 發送簡訊給我 |
事實上我的英文很爛,所以只好硬著頭皮比較 Free 和 Release 較大的區別
試著說說看,若有錯誤還請諸學長指教
Release 和 Free 都是用來把元件解構並把所使用的記憶體釋回給系統
因為 Windows 程式是所謂事件驅動型式(有別於以前的程序型式)
所以有可能我們要把原件(Form 亦是元件) Free 時,剛好該元件正在處理
某一事件(也就是在 Event 程序中),如此會有 access violation 之錯誤。
若要避免 上述之情況 (並非 總是需要),就用 Release 代替 Free
就這樣,若有不清楚只好再研究囉 ●○○○○○●○○○○○●
竹密不妨水過,山高無礙雲飛
------
●○○○○○●○○○○○● 竹密不妨水過,山高無礙雲飛 |
m0210
一般會員 發表:31 回覆:29 積分:17 註冊:2002-08-23 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |