锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产高潮国产高潮久久久91,合区精品久久久中文字幕一区,久久综合噜噜激激的五月天http://www.shnenglu.com/flyingxu/to get ready...zh-cnTue, 06 May 2025 23:18:29 GMTTue, 06 May 2025 23:18:29 GMT60鎴戠殑鏂板崥瀹㈠湪 http://www.codediscuss.comhttp://www.shnenglu.com/flyingxu/archive/2007/10/02/33321.htmlflyingxuflyingxuTue, 02 Oct 2007 06:23:00 GMThttp://www.shnenglu.com/flyingxu/archive/2007/10/02/33321.htmlhttp://www.shnenglu.com/flyingxu/comments/33321.htmlhttp://www.shnenglu.com/flyingxu/archive/2007/10/02/33321.html#Feedback2http://www.shnenglu.com/flyingxu/comments/commentRss/33321.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/33321.html鎴戠殑鏂板崥瀹㈠湪

http://www.codediscuss.com
   鏂囩珷鎸囨暟:0  
http://www.codediscuss.com 鏄垜鐨勫崥瀹㈢殑鏂板湴鍧銆傝繕鏄互VC++緙栫▼涓轟富錛屾湁mfc錛岃嫳璇紝榪樻湁鐐圭偣shareware鐨勫唴瀹廣?br>


flyingxu 2007-10-02 14:23 鍙戣〃璇勮
]]>
鍏充簬IServiceProvider鐨勪竴綃囧緢濂界殑鏂囩珷http://www.shnenglu.com/flyingxu/archive/2007/01/05/17275.htmlflyingxuflyingxuThu, 04 Jan 2007 16:14:00 GMThttp://www.shnenglu.com/flyingxu/archive/2007/01/05/17275.htmlhttp://www.shnenglu.com/flyingxu/comments/17275.htmlhttp://www.shnenglu.com/flyingxu/archive/2007/01/05/17275.html#Feedback0http://www.shnenglu.com/flyingxu/comments/commentRss/17275.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/17275.htmlhttp://www.vckbase.com/vckbase/vckbase10/vc/nonctrls/atlcomocx_02/1002005.htm

鎴戣寰楄鐨勫緢娓呮錛屽懙鍛?img src ="http://www.shnenglu.com/flyingxu/aggbug/17275.html" width = "1" height = "1" />

flyingxu 2007-01-05 00:14 鍙戣〃璇勮
]]>
thinking in c++ 涔?fàn)棰樈{旀http://www.shnenglu.com/flyingxu/archive/2006/08/09/11022.htmlflyingxuflyingxuTue, 08 Aug 2006 16:19:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/08/09/11022.htmlhttp://www.shnenglu.com/flyingxu/comments/11022.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/08/09/11022.html#Feedback1http://www.shnenglu.com/flyingxu/comments/commentRss/11022.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/11022.html榪欎釜絳旀鏈潵鏄綔鑰呭崠閽辯殑錛屾垜蹇樹簡鏄粠閭d釜緗戠珯涓嬭澆鐨勪簡錛屼及璁′笉鍏ㄣ?br>鐜板湪鏈変漢瑕侊紝灝辨斁涓婃潵鍚?/p>

http://www.shnenglu.com/Files/flyingxu/ThinkinginCppExercise.rar

(鏈獙璇侊紝鍙兘涓嶅叏錛屾垨鑰呮牴鏈氨涓嶆槸絳旀)



flyingxu 2006-08-09 00:19 鍙戣〃璇勮
]]>
Memory leak in CWinThread?http://www.shnenglu.com/flyingxu/archive/2006/07/26/10557.htmlflyingxuflyingxuWed, 26 Jul 2006 11:11:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/07/26/10557.htmlhttp://www.shnenglu.com/flyingxu/comments/10557.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/07/26/10557.html#Feedback3http://www.shnenglu.com/flyingxu/comments/commentRss/10557.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/10557.html綾諱技鐨勯棶棰樿http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20084406.html

涓嬮潰鐨勪唬鐮侊紝褰撶敤AfxBeginThread寮濮嬩竴涓嚎紼嬫椂錛屽疄闄呬笂鏄湁鍐呭瓨娉勬紡鐨?/p>

for 聽(ii聽 = 0 ;聽ii聽 < 1000 ;聽ii ++ )聽
{
聽聽CWinThread聽
*
pWinThread;聽
聽聽pWinThread聽
=
聽AfxBeginThread(ThreadLBProc,聽NULL);
聽聽::Sleep(
500
);
}

UINT聽ThreadLBProc(LPVOID聽pParam)
{
聽聽
return 0
;
}

VC杈撳嚭鐨勫吀鍨嬫彁紺轟負(fù)錛?br />Detected memory leaks!
Dumping objects ->
thrdcore.cpp(166) : {782} client block at 0x00425300, subtype 0, 112 bytes long.
瀹為檯涓婏紝鍙鐪嬪埌鏄?font style="BACKGROUND-COLOR: #ffff00">thrdcore.cpp(166) 鐨勫唴瀛樻硠婕忥紝鍩烘湰灝辨槸鍚屼竴涓師鍥狅紝鍜屼笂闈㈢殑浠g爜涓鏍楓?br />瑙e喅鏂規(guī)硶錛?br />step 1)
鍦ㄧ嚎紼嬪嚱鏁頒腑錛岃寰楀啓AfxEndThread();(涓嶢fxBeginThread瀵瑰簲錛屽叾浠栫殑寮濮嬬嚎紼嬬殑鍑芥暟錛屾湁鐩稿簲鐨勫嚱鏁?
step 2)
鐢?:WaitForSingleObject()紜繚綰跨▼褰誨簳閫鍑?br />
step 2鏄瘮杈冨鏄撳拷鐣ョ殑錛岀敤sleep鍑芥暟鍙兘渚ュ垢鐨勪繚璇佺嚎紼嬮鍑猴紝浣嗕笉鑳界‘淇濄?img src ="http://www.shnenglu.com/flyingxu/aggbug/10557.html" width = "1" height = "1" />

flyingxu 2006-07-26 19:11 鍙戣〃璇勮
]]>
鍐嶈皟璇曠姸鎬佷笅錛屾寜涓婩12錛岀▼搴忓氨鍑洪敊浜嗭紙VC錛?/title><link>http://www.shnenglu.com/flyingxu/archive/2006/07/13/9818.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Thu, 13 Jul 2006 10:29:00 GMT</pubDate><guid>http://www.shnenglu.com/flyingxu/archive/2006/07/13/9818.html</guid><wfw:comment>http://www.shnenglu.com/flyingxu/comments/9818.html</wfw:comment><comments>http://www.shnenglu.com/flyingxu/archive/2006/07/13/9818.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/flyingxu/comments/commentRss/9818.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/flyingxu/services/trackbacks/9818.html</trackback:ping><description><![CDATA[鐢╒C璋冭瘯紼嬪簭錛屽彧瑕佹寜涓婩12錛岀▼搴忓氨鍑洪敊浜嗭紝鍑洪敊鐨勪唬鐮佽繕寰堝鎬紝鍐峆eekMessage涓紝浣嗘槸鍙嚭鐜板湪璋冭瘯錛堟寜F5錛夛紝涓嶅嚭鐜板湪鍏ㄩ熻繍琛岋紙Ctrl+F5錛夛紝release鐗堟湰涔熸病鏈夐棶棰?br />緗戜笂鐨勮В絳?<br /><a >http://support.microsoft.com/kb/q130667/</a>聽F12灞呯劧灝辨槸榪欎箞瀹氫箟鐨勶紝ft<br /><br />鎵浠ワ紝鍦ㄥ畾涔夌▼搴忓姛鑳界殑鏃跺欙紝灝卞敖閲忎笉瑕佺敤鍒癋12 錛屽搱<img src ="http://www.shnenglu.com/flyingxu/aggbug/9818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-07-13 18:29 <a href="http://www.shnenglu.com/flyingxu/archive/2006/07/13/9818.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Is MSDN wrong? or I made a mistake? about static member functionhttp://www.shnenglu.com/flyingxu/archive/2006/07/11/9697.htmlflyingxuflyingxuTue, 11 Jul 2006 11:14:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/07/11/9697.htmlhttp://www.shnenglu.com/flyingxu/comments/9697.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/07/11/9697.html#Feedback3http://www.shnenglu.com/flyingxu/comments/commentRss/9697.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/9697.htmlhttp://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.vc.mfc&tid=402a414c-a125-45bd-9cf4-c1819db7e3e4錛?br />
in聽http://msdn2.microsoft.com/en-us/library/480b7kf7.aspx,聽it聽says聽that聽
pGdiObject->DeleteTempMap()
;聽聽//聽Causes聽compiler聽error

But聽I'm聽confused聽for聽a聽static聽member聽can聽be聽called聽by聽the聽object聽or聽a聽pointer.
Is聽there聽anything聽wrong聽of聽my聽understanding?

鍥炵瓟鐨勪漢鍒拌洰澶氾紝璁ㄨ鐨勪篃寰堢儹鐑堬紝浣嗛兘娌℃湁鐩存帴鍥炵瓟鎴戠殑闂錛屾垜鐨勯棶棰樻槸錛屽浜庨潤鎬佸嚱鏁幫紝
pGdiObject->DeleteTempMap();聽聽//聽Causes聽compiler聽error錛?br />鍒板簳瀵逛笉瀵癸紵濡傛灉涓嶅錛屽氨鏄痬sdn閿欎簡錛屼笉榪囨昏寰楁瘮杈冨鎬紝msdn涓嶈鍑鴻繖鏍風(fēng)殑閿欑殑

flyingxu 2006-07-11 19:14 鍙戣〃璇勮
]]>
[zz]MFC榪斿洖鐨勪復(fù)鏃跺璞℃寚閽堟垚鍥?http://www.shnenglu.com/flyingxu/archive/2006/07/10/9663.htmlflyingxuflyingxuMon, 10 Jul 2006 15:18:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/07/10/9663.htmlhttp://www.shnenglu.com/flyingxu/comments/9663.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/07/10/9663.html#Feedback1http://www.shnenglu.com/flyingxu/comments/commentRss/9663.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/9663.htmlcsdn涓婇毦寰楃殑濂芥枃绔狅紝鎬曚笉浜夋皵鐨刢sdn緗戠珯榪囧嚑澶╁張鎵句笉鍒拌繖綃囨枃绔犱簡錛屾垜寰楀厛杞竴涓嬶紝淇濆瓨涓涓嬶細(xì)
http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=193097

Q : MFC榪斿洖鐨勪復(fù)鏃跺璞℃寚閽堟垚鍥?
涓昏瑙g瓟鑰? QunKangLi 鎻愪氦浜? QunKangLi
鎰熻阿: oldforest銆亂u_hl銆丵unKangLi
瀹℃牳鑰? happyparrot 紺懼尯瀵瑰簲璐村瓙: 鏌ョ湅
聽聽聽聽 A :

msdn鍦ㄤ粙緇岹etDlgItem鐨勬椂鍊欙紝鏄庣‘鎸囧嚭錛?聽
The 聽returned 聽pointer 聽may 聽be 聽temporary 聽and 聽should 聽not 聽be 聽stored 聽for 聽later 聽use. 聽
濡傛灉鐪熸槸榪欐牱閭f垜涓嶆儴浜嗭紒鍦ㄦ垜鐨勪竴涓蔣浠朵腑錛屽洜涓哄父甯歌浣垮垏鎹㈡寜閽殑鍙敤涓庝笉鍙敤浠ュ強鏀瑰彉鎸夐挳鏂囧瓧錛屾墍浠ユ垜鐢―etDlgItem鎶婂畠浠瓨浜嗚搗鏉ワ紝鐢ㄧ殑鏃跺欑洿鎺ュ埌鏁扮粍閲岄潰鍙栵紝榪欐牱鐨勮瘽榪欎釜杞歡涓嶆槸鐘簡涓涓噸澶х殑閿欒浜嗭紵鍙槸鐢ㄨ繖涔堜箙涔熸病鍑洪敊銆?聽
鍙﹀錛屽畠涔熸槸璇村彲鑳芥槸涓存椂鐨勶紝閭d竴瀹氬湪鏌愮鎯呭喌涓嬩笉鏄復(fù)鏃剁殑錛岄珮鎵嬭兘涓嶈兘瑙i噴涓涓嬭繖涓棶棰橈紵 聽
--------------------------------------------------------------- 聽
// 聽 聽Most 聽Windows 聽objects 聽are 聽represented 聽with 聽a 聽HANDLE, 聽including 聽
// 聽 聽 聽 聽 聽 聽the 聽most 聽important 聽ones, 聽HWND, 聽HDC, 聽HPEN, 聽HFONT 聽etc. 聽
// 聽 聽We 聽want 聽C++ 聽objects 聽to 聽wrap 聽these 聽handle 聽based 聽objects 聽whenever 聽we 聽can. 聽
// 聽 聽Since 聽Windows 聽objects 聽can 聽be 聽created 聽outside 聽of 聽C++ 聽(eg: 聽calling 聽
// 聽 聽 聽 聽 聽 聽::CreateWindow 聽will 聽return 聽an 聽HWND 聽with 聽no 聽C++ 聽wrapper) 聽we 聽must 聽
// 聽 聽 聽 聽 聽 聽support 聽a 聽reasonably 聽uniform 聽mapping 聽from 聽permanent 聽handles 聽
// 聽 聽 聽 聽 聽 聽(i.e. 聽the 聽ones 聽allocated 聽in 聽C++) 聽and 聽temporary 聽handles 聽(i.e. 聽
// 聽 聽 聽 聽 聽 聽the 聽ones 聽allocated 聽in 聽C, 聽but 聽passed 聽through 聽a 聽C++ 聽interface. 聽
// 聽 聽We 聽keep 聽two 聽dictionaries 聽for 聽this 聽purpose. 聽 聽The 聽permanent 聽dictionary 聽
// 聽 聽 聽 聽 聽 聽stores 聽those 聽C++ 聽objects 聽that 聽have 聽been 聽explicitly 聽created 聽by 聽
// 聽 聽 聽 聽 聽 聽the 聽developer. 聽 聽The 聽C++ 聽constructor 聽for 聽the 聽wrapper 聽class 聽will 聽
// 聽 聽 聽 聽 聽 聽insert 聽the 聽mapping 聽into 聽the 聽permanent 聽dictionary 聽and 聽the 聽C++ 聽
// 聽 聽 聽 聽 聽 聽destructor 聽will 聽remove 聽it 聽and 聽possibly 聽free 聽up 聽the 聽associated 聽
// 聽 聽 聽 聽 聽 聽Windows 聽object. 聽
// 聽 聽When 聽a 聽handle 聽passes 聽through 聽a 聽C++ 聽interface 聽that 聽doesn't 聽exist 聽in 聽
// 聽 聽 聽 聽 聽 聽the 聽permanent 聽dictionary, 聽we 聽allocate 聽a 聽temporary 聽wrapping 聽object 聽
// 聽 聽 聽 聽 聽 聽and 聽store 聽that 聽mapping 聽into 聽the 聽temporary 聽dictionary. 聽
// 聽 聽At 聽idle 聽time 聽the 聽temporary 聽wrapping 聽objects 聽are 聽flushed 聽(since 聽you 聽better 聽
// 聽 聽 聽 聽 聽 聽not 聽be 聽holding 聽onto 聽something 聽you 聽didn't 聽create). 聽
// 聽


鍦–WinThread::OnIdle閲岃皟鐢ˋfxUnlockTempMaps錛孉fxUnlockTempMaps浼?xì)閲婃斁temporary 聽maps. 聽

鎵浠ヤ笉瑕佷繚鐣橤etDlgItem絳夎繑鍥炵殑涓存椂鎸囬拡錛屽彲浠ョ洿鎺ヤ繚瀛楬WND 聽objects錛岀劧鍚嶤Wnd::FromHandle鑾峰彇涓存椂鎸囬拡鏉ョ敤銆?聽

--------------------------------------------------------------- 聽

涓存椂鍖呰瀵硅薄浼?xì)鍦ńI洪棽鏃墮棿鍒犻櫎.鍦ㄥ悓涓鍑芥暟涓嬈′嬌鐢ㄦ槸娌$敤闂鐨?涓嶅悓鍑芥暟涓嬌鐢ㄥ厛鍓嶄繚瀛樹笅鏉ョ殑鎸囬拡灝辨湁鍙兘鍑洪敊,鐗瑰埆鏄璇濇鍒濅嬌鍖栨椂鍊欏瓨涓嬫潵鐨勬寚閽? 聽
聽 聽 聽 聽鍦∕FC灞傛涓婄殑鍑芥暟浣跨敤CWnd瀵硅薄,鑰屾湰鍦癢indows浠g爜(API)浣跨敤鍙ユ焺.濡?褰揥indows緋葷粺璋冪敤涓涓獥鍙h繃紼嬫椂灝嗕紶閫掍竴涓狧WND鍙傛暟,鑰孧FC鏈韓鐨勬秷鎭満鍒朵嬌鐢–Wnd綾?涓轟簡鏇村ソ鏇撮珮鏁堢殑瀹炵幇,MFC闇瑕佷笌Windows緋葷粺鍚堜綔,灝嗗彞鏌勪笌CWnd瀵硅薄榪涜鍏寵仈---瀹冪敤CHandleMap瀹屾垚鍏寵仈. 聽
CHandleMap鏈変袱涓狢MapPtrToPtr鐨勬垚鍛樺彉閲?m_permanentMap(姘鎬箙鏄犲皠琛?紼嬪簭榪愯榪囩▼涓璞?鍙ユ焺涔嬮棿鐨勫叧緋?,m_temporaryMap(涓存椂鏄犲皠琛?鍦ㄦ秷鎭瓨鍦ㄧ殑榪囩▼涓墠瀛樺湪).姘鎬箙琛ㄤ繚瀛樻樉寮忓垱寤虹殑CWnd瀵硅薄,褰撳璞″垱寤烘椂灝嗗湪姘鎬箙鐩綍涓嬫彃鍏ヤ竴涓潯鐩?鍦–Wnd::OnNcDestrory鏃跺垹闄ゅ搴旀潯鐩?浣嗘槸Windows鏈夋椂浼?xì)浼犲叆鏌愪簺涓嶆槸鐢卞紑鍙戜漢鍛樻樉寮忓垱寤虹殑紿楀彛鐨勫彞鏌?姝ゆ椂MFC浼?xì)鍒嗛厤涓涓復(fù)鏃跺璞℃潵鍖呰榪欎釜鍙ユ焺騫跺皢瀹冧滑鐨勬槧灝勪繚瀛樺埌涓存椂鏄犲皠琛ㄤ腑,榪欎簺涓存椂瀵硅薄浼?xì)鍦ńI洪棽鏃墮棿琚垹闄ゅ茍縐昏蛋鐩稿簲鐨勪復(fù)鏃舵槧灝勮〃鏉$洰.綾諱技鐨凪FC瀵硅薄涓嶹indows鍙ユ焺鐨勬槧灝勮〃鏈? 聽
m_pmapHWND: 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽紿楀彛鍙ユ焺涓嶤Wnd瀵硅薄 聽
m_pampHMENU: 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽鑿滃崟鍙ユ焺涓嶤Menu瀵硅薄 聽
m_pmapHDC: 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽璁懼鐜鍙ユ焺涓嶤DC瀵硅薄 聽
m_pmapHGDIOBJ: 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽 聽聽GDI鍙ユ焺涓嶤GDI瀵硅薄 聽
m_mapHIMAGELIST: 聽聽 聽聽 聽聽 聽聽鍥懼儚閾捐〃鍙ユ焺鍒癈ImageList瀵硅薄 聽

褰撶粰瀹氬彞鏌?濡侶WND鏃?MFC綆鍗曡皟鐢–Wnd* 聽PASCAL 聽CWnd::FromHandle(HWND 聽hWnd), 聽姝ゅ嚱鏁板唴閮ㄤ嬌鐢–HandleMap::FromHandle(hWnd)鑾峰彇鐩稿叧鑱旂殑CWnd瀵硅薄.鍦–HandleMap::FromHandle(h)鍐呴儴(婧愪唬鐮佸湪WinHand.cpp),鍏堜嬌鐢–Object* 聽pObject 聽= 聽LookupPermanent(h); 聽聽 聽聽 聽聽 聽聽if 聽(pObject 聽!= 聽NULL)return 聽pObject; 聽 聽媯鏌ユ案涔呰〃;濡傛案涔呰〃涓笉瀛樺湪,浣跨敤pObject 聽= 聽LookupTemporary(h)) 聽!= 聽NULL媯鏌ヤ復(fù)鏃惰〃,閮戒笉瀛樺湪鏃?浣跨敤pTemp 聽= 聽= 聽m_pClass->CreateObject();if 聽(pTemp 聽== 聽NULL)AfxThrowMemoryException();m_temporaryMap.SetAt((LPVOID)h, 聽pTemp);鍒涘緩涓存椂瀵硅薄騫跺皢鍏舵彃鍏ュ埌涓存椂琛ㄤ腑鍘?鍚屾椂榪斿洖璇ヤ復(fù)鏃跺璞? 聽
void 聽CHandleMap::RemoveHandle(HANDLE 聽h)鐨勬敞閲婅鏄庝復(fù)鏃跺璞″皢鍦ㄧ┖闂叉椂鐢監(jiān)nIdel閲婃斁: 聽
聽聽 聽聽 聽聽 聽聽// 聽remove 聽only 聽from 聽permanent 聽map 聽-- 聽temporary 聽objects 聽are 聽removed 聽
聽聽 聽聽 聽聽 聽聽// 聽 聽at 聽idle 聽in 聽CHandleMap::DeleteTemp, 聽always! 聽
濡傛灉鎯充笉鑷姩閲婃斁涓存椂瀵硅薄,浣跨敤void 聽AFXAPI 聽AfxLockTempMaps()/BOOL 聽AFXAPI 聽AfxUnlockTempMaps(BOOL 聽bDeleteTemps)榪涜閿佸畾. 聽





flyingxu 2006-07-10 23:18 鍙戣〃璇勮
]]>
bug錛?OnIdle called only while mouse's movinghttp://www.shnenglu.com/flyingxu/archive/2006/07/09/9593.htmlflyingxuflyingxuSat, 08 Jul 2006 18:03:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/07/09/9593.htmlhttp://www.shnenglu.com/flyingxu/comments/9593.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/07/09/9593.html#Feedback1http://www.shnenglu.com/flyingxu/comments/commentRss/9593.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/9593.htmlhttp://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.vc.mfc&mid=1aa1eddf-7bcf-407b-84fe-234fe0975331&sloc=en-us錛?br />
I聽need聽to聽update聽one聽class聽data聽and聽the聽view聽during聽the聽idle,聽I聽used聽this聽聽
method聽
in聽the聽Cdoc:
void聽CMyAppDoc::OnIdle(){

聽聽聽聽theClass
->
Update();
聽聽聽聽POSITION聽pos聽
=
聽GetFirstViewPosition();
聽聽聽聽CView
*聽pView聽=
聽GetNextView(pos);
聽聽聽聽pView
->Invalidate(true
);
聽聽聽聽pView
->
UpdateWindow();聽聽聽聽
}


It聽works聽only聽when聽I聽move聽the聽mouse,聽what
's聽wrong?聽Z_Z
榪欎釜闂鐨勭‘姣旇緝鎼烇紝瑕佸ソ濂界湅mfc婧愮爜鐨勶紝涓嬮潰鏄垜鐨勫洖絳?br />Nothing is wrong, I can explain it聽 is by design.
Please take a look at the source code of int CWinThread::Run(), in that function, IsIdleMessage() is called, and in IsIdleMessage() WM_PAINT is ignored, which means WM_PAINT will not cause OnIdle to be called, for windows think it's just a WM_PAINT message and will not change the UI.
Your UpdateWindow() only post a WM_PAINT message, the message queue is not empty but it's ignored by IsIdleMessage(), that's why.
But when you move your mouse, the message queue is filled with some WM_MOUSEMOVE and it's not ignored for the position changes. So your OnIdle() is called again.
-
My suggestion is to move your Invalidate & UpdateWindow code to somewhere else.
OnIdle錛堬級鐨勭‘鏄釜鏈夌偣澶嶆潅鐨勯棶棰橈紝鎴戝彲鑳借繕浼?xì)鍐欏嚑绡囨枃绔?錛氾級
榪欓噷錛?a >http://groups.google.com/group/microsoft.public.vc.mfc/browse_thread/thread/14f20aa5ffd6994d/66b6e5949a31bfa2?lnk=st&q=AfxUnlockTempMaps&rnum=40&hl=zh-CN#66b6e5949a31bfa2錛夋湁綃囨枃绔犺鐨勫緢鍒頒綅

flyingxu 2006-07-09 02:03 鍙戣〃璇勮
]]>
_asm int 3 鐨勪竴涓簲鐢細(xì)鍦ㄧ▼搴忚繍琛屽悗鍐嶈繘鍏ヨ皟璇曞櫒http://www.shnenglu.com/flyingxu/archive/2006/07/06/9493.htmlflyingxuflyingxuThu, 06 Jul 2006 09:35:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/07/06/9493.htmlhttp://www.shnenglu.com/flyingxu/comments/9493.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/07/06/9493.html#Feedback10http://www.shnenglu.com/flyingxu/comments/commentRss/9493.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/9493.html1錛夊惎鍔ㄨ皟璇曞櫒錛屾瘮濡俈C
2錛夊湪VC涓鏂偣
3錛夋搷浣滅▼搴忥紝浣垮緱紼嬪簭榪愯鍒版柇鐐癸紝鍋滀笅鏉?br />浣嗘槸鐜板湪鎴戦亣鍒頒竴涓儏鍐碉紝甯屾湜璋冭瘯鐨勬儏鏅槸榪欐牱鐨勶細(xì)鍙屽嚮鏌愪釜鏂囦歡錛屾垜鐨勭▼搴忓惎鍔ㄥ悗錛岃繖涓椂鍊欐垜鎯崇▼搴忓仠涓嬫潵錛岃鎴戝湪VC涓皟璇曞畠銆?br />浣嗘槸錛屽弻鍑?yán)L枃浠跺悗鍚姩鐨勭▼搴忥紝鏄釜鐙珛鐨別xe榪愯紼嬪簭錛岃偗瀹氫笉鏄湪VC鐨勮繍琛屾帶鍒朵笅鐨勶紝VC涓緗殑鏂偣涓嶈搗浣滅敤鐨勩傛庝箞鍔炲憿錛?br />榪欎釜鏃跺欏彲浠ュ湪鎯寵紼嬪簭鍋滀笅鏉ョ殑鍦版柟澧炲姞鎸囦護_asm int 3錛宒ebug涓嬬紪璇戝ソ銆傚弻鍑?yán)L枃浠跺悗榪愯榪欎釜exe錛屽湪exe榪愯鍒癬asm int 3鏃訛紝灝變細(xì)涓柇錛岃屾妸褰撳墠鐨別xe榪愯涓庝竴涓柊鐨勮皟璇曞櫒錛堜竴涓柊鐨刅C榪涚▼錛夌粨鍚堣搗鏉ャ傛帴涓嬫潵灝卞儚涓鑸殑璋冭瘯浜嗐?br />榪欐椂鐨勮皟璇曟楠ょ被浼間笌錛?br />1錛夌▼搴忚繍琛?br />2錛夐亣鍒扮壒瀹氭潯浠舵椂錛宊asm int 3鎶婂綋鍓峞xe涓庝竴涓柊鐨勮皟璇曞櫒錛屾瘮濡備竴涓柊鐨刅C榪涚▼錛岃仈緋昏搗鏉?br />3錛夊湪璋冭瘯鍣ㄤ腑璋冭瘯exe

錛氾級

flyingxu 2006-07-06 17:35 鍙戣〃璇勮
]]>
Make header files self-sufficient鐨勪竴涓緥瀛?/title><link>http://www.shnenglu.com/flyingxu/archive/2006/06/23/8908.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Fri, 23 Jun 2006 12:56:00 GMT</pubDate><guid>http://www.shnenglu.com/flyingxu/archive/2006/06/23/8908.html</guid><wfw:comment>http://www.shnenglu.com/flyingxu/comments/8908.html</wfw:comment><comments>http://www.shnenglu.com/flyingxu/archive/2006/06/23/8908.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.shnenglu.com/flyingxu/comments/commentRss/8908.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/flyingxu/services/trackbacks/8908.html</trackback:ping><description><![CDATA[C錛嬶紜緙栫▼瑙勮寖涓23鏉′腑璇達細(xì)<br />If one header file won't work unless the file that includes it also includes another header, that's gauche and puts unnecessary burden on that header file's users.<br />鍛靛懙錛岃嫳璇湁鐐規(guī)嫍鍙o紝鍚庨潰涓劇殑渚嬪瓙涔熼兘鏄ā鏉跨殑渚嬪瓙銆傛垜鍊掓槸閬囧埌榪囦竴涓疄闄呯殑渚嬪瓙錛岀畝鍖栧悗濡備笅錛?br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font face="Courier New"><span style="COLOR: #008000">//</span><span style="COLOR: #008000">a.h</span></font><span style="COLOR: #008000"><br /></span><span style="COLOR: #0000ff"><font face="Courier New">class</font></span><font face="Courier New"><span style="COLOR: #000000">聽A聽<br />{<br />聽</span><span style="COLOR: #0000ff">int</span></font><span style="COLOR: #000000"><font face="Courier New">聽a;<br />};</font></span></div>聽<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008000">//</span><span style="COLOR: #008000">b.h<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">娉ㄦ剰錛歜.h騫舵病鏈塱nclude聽a.h</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #0000ff"><font face="Courier New">class</font></span><span style="COLOR: #000000"><font face="Courier New">聽B聽<br />{<br />聽A聽a;<br />};</font>聽</span></div>鐢ㄧ殑鏃跺欐庝箞鐢ㄥ憿錛熸瘮濡傚湪main.cpp涓兂鐢╟lass B<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font face="Courier New"><span style="COLOR: #008000">//</span><span style="COLOR: #008000">main.cpp</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">#include聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">a.h</span><span style="COLOR: #000000">"</span></font><span style="COLOR: #000000"><br /><font face="Courier New">#include聽</font></span><font face="Courier New"><span style="COLOR: #000000">"</span><span style="COLOR: #000000">b.h</span><span style="COLOR: #000000">"</span></font><span style="COLOR: #000000"><br /></span><font face="Courier New"><span style="COLOR: #008000">//</span><span style="COLOR: #008000"><img src="http://www.shnenglu.com/images/dot.gif" /></span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">B聽b;<br /></span><span style="COLOR: #008000">//</span></font><font face="Courier New"><span style="COLOR: #008000"><img src="http://www.shnenglu.com/images/dot.gif" /><br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">do聽something聽on聽b</span></font></div>鍙互鐪嬪埌錛宮ain涓轟簡浣跨敤B錛岃繕寰楀寘鍚玜.h錛岃繖灝辨槸涓婇潰涓孌佃嫳璇鐨勶細(xì)<br />濡傛灉涓涓ご鏂囦歡錛坆.h錛変笉鑳藉伐浣滐紝闄ら潪鍖呭惈瀹冿紙b.h錛夌殑鏂囦歡錛堜篃灝辨槸main.cpp錛変篃鍖呭惈鍙︿竴涓ご鏂囦歡錛坅.h錛?..<br /><br />hehe錛屽綋鎴戠涓嬈¢亣鍒拌繖縐嶆儏鍐墊椂錛屾兂浜嗗崐澶╀篃鎯充笉鏄庣櫧涓轟粈涔堟垜鏄庢槑鍖呭惈浜哹.h榪樻槸涓嶈兘鐢˙鍟?br /><br />閭d箞錛屾紜殑鍐欐硶搴旇鏄粈涔堝憿錛?br />鍦ㄧ被B鐨勪綔鑰呭湪璁捐B鐨勬椂鍊欙紝灝卞簲璇ユ兂鍒扮敤鎴峰彧闇瑕?include "b.h"灝卞彲浠ヤ嬌鐢ㄨ繖涓猚lass B銆傛墍浠ワ紝鍦╞.h鏂囦歡涓紝搴旇鍐欐槑#include "a.h"錛岃屼笉鏄鐢ㄦ埛鍦╩ain.cpp涓幓include "a.h"<br /><br />:)<img src ="http://www.shnenglu.com/flyingxu/aggbug/8908.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-06-23 20:56 <a href="http://www.shnenglu.com/flyingxu/archive/2006/06/23/8908.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.yjtrade.cn" target="_blank">欧美麻豆久久久久久中文</a>| <a href="http://www.52zx45.cn" target="_blank">久久夜色精品国产亚洲</a>| <a href="http://www.tuht.cn" target="_blank">久久久久久久精品妇女99</a>| <a href="http://www.168yetibizhi.cn" target="_blank">国产69精品久久久久APP下载</a>| <a href="http://www.6t0n.cn" target="_blank">亚洲狠狠婷婷综合久久久久</a>| <a href="http://www.nboys.cn" target="_blank">久久精品国产影库免费看</a>| <a href="http://www.zjhongfeng.cn" target="_blank">久久性生大片免费观看性</a>| <a href="http://www.gjgwyks.cn" target="_blank">亚洲日韩中文无码久久</a>| <a href="http://www.maosite.cn" target="_blank">Xx性欧美肥妇精品久久久久久 </a>| <a href="http://www.jwpicture.cn" target="_blank">69SEX久久精品国产麻豆</a>| <a href="http://www.ksjhyt.cn" target="_blank">国产成人无码精品久久久免费</a>| <a href="http://www.whcxjj.cn" target="_blank">久久久久久亚洲精品影院</a>| <a href="http://www.lpnppddrppp.cn" target="_blank">久久99国产精品久久</a>| <a href="http://www.bjnyjdxcj.cn" target="_blank">久久人妻少妇嫩草AV蜜桃</a>| <a href="http://www.hbjyhg.cn" target="_blank">久久久久久久久久免免费精品 </a>| <a href="http://www.jhitezpt.cn" target="_blank">亚洲中文字幕久久精品无码APP</a>| <a href="http://www.fvnnv.cn" target="_blank">久久综合久久久</a>| <a href="http://www.duansisi.cn" target="_blank">亚洲中文字幕无码久久综合网</a>| <a href="http://www.keyboo.cn" target="_blank">久久精品无码一区二区三区日韩</a>| <a href="http://www.shaoxing2010.cn" target="_blank">久久影院综合精品</a>| <a href="http://www.dsifhjh1.cn" target="_blank">久久久久久久波多野结衣高潮 </a>| <a href="http://www.tthzk.cn" target="_blank">久久天天躁夜夜躁狠狠躁2022 </a>| <a href="http://www.034867.cn" target="_blank">久久精品国产乱子伦</a>| <a href="http://www.ffwfwj.cn" target="_blank">久久99精品国产麻豆蜜芽</a>| <a href="http://www.269sihu.cn" target="_blank">国产精品久久久久jk制服</a>| <a href="http://www.utql.cn" target="_blank">亚洲欧洲中文日韩久久AV乱码</a>| <a href="http://www.0717zf.cn" target="_blank">青青草原1769久久免费播放</a>| <a href="http://www.sunwebs.cn" target="_blank">麻豆亚洲AV永久无码精品久久 </a>| <a href="http://www.onlinehotel.com.cn" target="_blank">国产精品无码久久久久</a>| <a href="http://www.umtd.cn" target="_blank">99精品国产在热久久无毒不卡 </a>| <a href="http://www.win42.cn" target="_blank">久久人妻无码中文字幕</a>| <a href="http://www.kottbac.cn" target="_blank">青春久久</a>| <a href="http://www.yiyaosheji.cn" target="_blank">久久夜色精品国产亚洲av</a>| <a href="http://www.zqyipin.cn" target="_blank">久久精品国产99久久香蕉</a>| <a href="http://www.abcvi.cn" target="_blank">久久精品国产99国产精品</a>| <a href="http://www.dgjiajun.net.cn" target="_blank">久久成人永久免费播放</a>| <a href="http://www.gdswky.cn" target="_blank">久久97久久97精品免视看</a>| <a href="http://www.fengguan1688.cn" target="_blank">国产精品久久久久乳精品爆</a>| <a href="http://www.jnxlt.cn" target="_blank">久久久精品国产亚洲成人满18免费网站</a>| <a href="http://www.bxauomc.cn" target="_blank">婷婷综合久久中文字幕</a>| <a href="http://www.nfnv.cn" target="_blank">精品久久久久久久久久久久久久久 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>