锘??xml version="1.0" encoding="utf-8" standalone="yes"?>99久久99久久精品国产片果冻 ,99久久久精品免费观看国产,久久国产影院http://www.shnenglu.com/flyingxu/category/1483.htmlto get ready...zh-cnMon, 19 May 2008 13:03:25 GMTMon, 19 May 2008 13:03:25 GMT60Memory 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 聽(tīng)(ii聽(tīng) = 聽(tīng) 0 ;聽(tīng)ii聽(tīng) < 聽(tīng) 1000 ;聽(tīng)ii ++ )聽(tīng)
{
聽(tīng)聽(tīng)CWinThread聽(tīng)
*
pWinThread;聽(tīng)
聽(tīng)聽(tīng)pWinThread聽(tīng)
=
聽(tīng)AfxBeginThread(ThreadLBProc,聽(tīng)NULL);
聽(tīng)聽(tīng)::Sleep(
500
);
}

UINT聽(tīng)ThreadLBProc(LPVOID聽(tīng)pParam)
{
聽(tīng)聽(tīng)
return 聽(tīng) 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錛岀▼搴忓氨鍑洪敊浜?jiǎn)锛圴C錛?/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錛岀▼搴忓氨鍑洪敊浜?jiǎn)锛屽嚭閿欑殑浠g爜杩樺緢濂囨紝鍐峆eekMessage涓紝浣嗘槸鍙嚭鐜板湪璋冭瘯錛堟寜F5錛夛紝涓嶅嚭鐜板湪鍏ㄩ熻繍琛岋紙Ctrl+F5錛夛紝release鐗堟湰涔熸病鏈夐棶棰?br />緗戜笂鐨勮В絳?<br /><a >http://support.microsoft.com/kb/q130667/</a>聽(tīng)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>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聽(tīng)need聽(tīng)to聽(tīng)update聽(tīng)one聽(tīng)class聽(tīng)data聽(tīng)and聽(tīng)the聽(tīng)view聽(tīng)during聽(tīng)the聽(tīng)idle,聽(tīng)I(yíng)聽(tīng)used聽(tīng)this聽(tīng)聽(tīng)
method聽(tīng)
in聽(tīng)the聽(tīng)Cdoc:
void聽(tīng)CMyAppDoc::OnIdle(){

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


It聽(tīng)works聽(tīng)only聽(tīng)when聽(tīng)I(yíng)聽(tīng)move聽(tīng)the聽(tīng)mouse,聽(tīng)what
's聽(tīng)wrong?聽(tīng)Z_Z
榪欎釜闂鐨勭‘姣旇緝鎼烇紝瑕佸ソ濂界湅mfc婧愮爜鐨勶紝涓嬮潰鏄垜鐨勫洖絳?br />Nothing is wrong, I can explain it聽(tīng) 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錛堬級(jí)鐨勭‘鏄釜鏈夌偣澶嶆潅鐨勯棶棰橈紝鎴戝彲鑳借繕?shù)細(xì)鍐欏嚑绡囨枃绔?錛氾級(jí)
榪欓噷錛?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#Feedback8http://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 />榪欎釜鏃跺欏彲浠ュ湪鎯寵紼嬪簭鍋滀笅鏉ョ殑鍦版柟澧炲姞鎸囦護(hù)_asm int 3錛宒ebug涓嬬紪璇戝ソ銆傚弻鍑?yán)L枃浠跺悗榪愯榪欎釜exe錛屽湪exe榪愯鍒癬asm int 3鏃訛紝灝變細(xì)涓柇錛岃屾妸褰撳墠鐨別xe榪愯涓庝竴涓柊鐨勮皟璇曞櫒錛堜竴涓柊鐨刅C榪涚▼錛夌粨鍚堣搗鏉ャ傛帴涓嬫潵灝卞儚涓鑸殑璋冭瘯浜?jiǎn)銆?br />榪欐椂鐨勮皟璇曟楠ょ被浼間笌錛?br />1錛夌▼搴忚繍琛?br />2錛夐亣鍒扮壒瀹氭潯浠舵椂錛宊asm int 3鎶婂綋鍓峞xe涓庝竴涓柊鐨勮皟璇曞櫒錛屾瘮濡備竴涓柊鐨刅C榪涚▼錛岃仈緋昏搗鏉?br />3錛夊湪璋冭瘯鍣ㄤ腑璋冭瘯exe

錛氾級(jí)

flyingxu 2006-07-06 17:35 鍙戣〃璇勮
]]>
緙栬瘧浼樺寲閫夐」涓嶅尮閰嶅紩璧風(fēng)殑涓涓猙ughttp://www.shnenglu.com/flyingxu/archive/2006/06/02/8075.htmlflyingxuflyingxuFri, 02 Jun 2006 02:32:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/06/02/8075.htmlhttp://www.shnenglu.com/flyingxu/comments/8075.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/06/02/8075.html#Feedback0http://www.shnenglu.com/flyingxu/comments/commentRss/8075.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/8075.html浠婂ぉ閬囧埌涓涓棶棰樻洿濂囨?閮芥槸debug鐗堟湰,浣嗘槸exe鍜宒ll鐨刼ptimizations璁劇疆涓嶄竴鏍?閮戒細(xì)鍑?guó)檸悕鐨勯敊璇?鍑洪敊琛屾洿鎼炵瑧,鏄?br />m_ComboBox.AddString(_T("") )
鎬庝箞鏌ヤ篃鏌ヤ笉鍑洪棶棰?鎶婁紭鍖栭夐」鏀規(guī)垚涓鑷撮棶棰樺氨娌℃湁浜?鎼炰笉鎳?img src ="http://www.shnenglu.com/flyingxu/aggbug/8075.html" width = "1" height = "1" />

flyingxu 2006-06-02 10:32 鍙戣〃璇勮
]]>
閿欒鎻愮ず"An unsupported operation was attempted"鐨勫師鍥?/title><link>http://www.shnenglu.com/flyingxu/archive/2006/05/31/7963.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Wed, 31 May 2006 09:27:00 GMT</pubDate><guid>http://www.shnenglu.com/flyingxu/archive/2006/05/31/7963.html</guid><wfw:comment>http://www.shnenglu.com/flyingxu/comments/7963.html</wfw:comment><comments>http://www.shnenglu.com/flyingxu/archive/2006/05/31/7963.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/flyingxu/comments/commentRss/7963.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/flyingxu/services/trackbacks/7963.html</trackback:ping><description><![CDATA[緙栬瘧濂戒簡(jiǎn),榪愯涓涓▼搴?璇曞浘鎵撳紑涓涓璇濇鏃?瀵硅瘽妗嗗嚭涓嶆潵,鍙嶅掓槸鍑烘潵涓涓敊璇彁紺?<br />"An unsupported operation was attempted"<br />鎼滀簡(jiǎn)涓涓?<a ><br />http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21023191.html</a>閲岄潰鏈夊洖絳?鐨勭‘鏄偅鏍風(fēng)殑,鏄痳esource id鐨勯棶棰?<br /><br />閿欒鍘熷洜:<br />寮濮?緇欎竴涓猺adio鏄犲皠浜?jiǎn)涓涓彉閲?<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: #000000"><font face="Courier New">聽(tīng)DDX_Radio(pDX,聽(tīng)I(yíng)DC_RADIO1,聽(tīng)m_nFindType);</font></span></div>鍚庢潵鍙戠幇<u>IDC_RADIO1</u>榪欎釜id涓嶅ソ,鏀逛負(fù)聽(tīng)DDX_Radio(pDX, <u>IDC_RADIO_BIT,</u> m_nFindType);<br />緙栬瘧褰撶劧涓嶄細(xì)鍑洪敊,榪愯鏃?灝卞嚭鐜板紓甯鎬簡(jiǎn).濡傛灉鍦ㄤ笂闈㈢殑浠g爜涓婅涓柇鐐?鐒跺悗璺熻釜榪涘幓,鐪嬬殑闈炲父娓呮.<br /><br /><img src ="http://www.shnenglu.com/flyingxu/aggbug/7963.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-05-31 17:27 <a href="http://www.shnenglu.com/flyingxu/archive/2006/05/31/7963.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍦∣nPaint()浣跨敤涓ゆCPaintDC錛屽叧浜?:BeginPaint()/::EndPaint()http://www.shnenglu.com/flyingxu/archive/2006/05/22/7517.htmlflyingxuflyingxuMon, 22 May 2006 15:39:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/05/22/7517.htmlhttp://www.shnenglu.com/flyingxu/comments/7517.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/05/22/7517.html#Feedback3http://www.shnenglu.com/flyingxu/comments/commentRss/7517.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/7517.html榛樿鐨勪唬鐮佸涓嬶細(xì)
void聽(tīng)CHideSplitterWnd::OnPaint()聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)CPaintDC聽(tīng)dc(
this);聽(tīng)//
聽(tīng)device聽(tīng)context聽(tīng)for聽(tīng)painting
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//
聽(tīng)TODO:聽(tīng)Add聽(tīng)your聽(tīng)message聽(tīng)handler聽(tīng)code聽(tīng)here
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)Do聽(tīng)not聽(tīng)call聽(tīng)CSplitterWnd::OnPaint()聽(tīng)for聽(tīng)painting聽(tīng)messages

}
wizard娣誨姞鐨勪唬鐮佸眳鐒舵湁榪欐牱涓琛岋細(xì)//聽(tīng)Do聽(tīng)not聽(tīng)call聽(tīng)CSplitterWnd::OnPaint()聽(tīng)for聽(tīng)painting聽(tīng)messages錛屽悗闈㈡湁涓寽嫻嬨?br />鐒跺悗鎴戠戶緇啓鎴戠殑鍑芥暟錛?br />
void聽(tīng)CHideSplitterWnd::OnPaint()聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)CPaintDC聽(tīng)dc(
this);聽(tīng)//
聽(tīng)device聽(tīng)context聽(tīng)for聽(tīng)painting
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)璋冪敤鍩虹被錛屽厛

聽(tīng)聽(tīng)聽(tīng)聽(tīng)CSplitterWnd::OnPaint();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//
鍒╃敤dc鐢諱竴浜涘埆鐨勪笢瑗匡紝浣嗘槸瀹為檯涓婏紝瀹冧滑姘歌繙涓嶄細(xì)琚敾鍑烘潵
聽(tīng)聽(tīng)聽(tīng)//闄ら潪涓嶈皟鐢ㄥ熀綾葷殑OnPaint()

聽(tīng)聽(tīng)聽(tīng)聽(tīng)m_rectButton.DrawButton(&dc);
}
緇撴灉鎴戞坊鍔犵殑涓滆タ鎬庝箞涔熶笉浼?xì)琚斦d嚭鏉ワ紝涓轟粈涔堜細(xì)榪欐牱錛?br />

鐪嬩簡(jiǎn)CSplitterWnd::OnPaint()鐨勪唬鐮侊紝鍙戠幇瀹冧篃鐢ㄤ簡(jiǎn)涓涓狢PaintDC錛岃屼笖涔熸槸涓復(fù)鏃跺彉閲?br />
void聽(tīng)CSplitterWnd::OnPaint()
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)ASSERT_VALID(
this
);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)CPaintDC聽(tīng)dc(
this);
鑰屽叧閿殑鍦版柟灝卞湪CPaintDC鐨刢tor鍜宒tor涓簡(jiǎn)錛氬湪CPaintDC鐨刢tor涓皟鐢ㄤ簡(jiǎn)
::BeginPaint(m_hWnd聽(tīng)=聽(tīng)pWnd->m_hWnd,聽(tīng)&m_ps)
鑰屽湪CPaintDC鐨刣tor涓皟鐢ㄤ簡(jiǎn)
::EndPaint(m_hWnd,聽(tīng)&m_ps);
鑰岋細(xì)BeginPaint鏄紑濮嬫牴鎹綋鍓嶇殑cliprect鏉ョ敾錛孍ndPaint鍒欎細(xì)娓呯┖褰撳墠鐨刢liprect銆?br />

鎵浠ワ紝鍓嶉潰璋冪敤鍩虹被鐨凮nPaint鐨勮繃紼嬬粨鏉熷悗錛屽綋鍓嶇殑cliprect涓篘ULL錛屾墍浠ワ紝絎簩涓狢PaintDC鍦ㄨ鍥劇敾鐐逛粈涔堟椂錛宑liprect宸茬粡涓篘ULL錛屽綋鐒朵粈涔堜篃鐢諱笉涓婂幓浜?錛氾級(jí)

濡傛灉鎴戜竴瀹氭兂鍐嶇敤CPaintDC鐢葷偣浠涔堬紝鎬庝箞鍔烇紵鍐嶆璋冪敤InvalidateRect錛屼嬌寰梒liprect涓嶄負(fù)絀恒?/font>
void聽(tīng)CHideSplitterWnd::OnPaint()聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng) //娉ㄦ剰涓存椂鍙橀噺澹版槑鐨勯『搴忥紝鍥犱負(fù)BeginPaint/EndPaint鏄笉鏀寔宓屽鐨?br />聽(tīng)聽(tīng)聽(tīng)聽(tīng)//CPaintDC聽(tīng)dc(
this);聽(tīng)//
聽(tīng)device聽(tīng)context聽(tīng)for聽(tīng)painting
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)TODO:聽(tīng)Add聽(tīng)your聽(tīng)message聽(tīng)handler聽(tīng)code聽(tīng)here

聽(tīng)聽(tīng)聽(tīng)聽(tīng)CSplitterWnd::OnPaint();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng) //絎簩姝よ皟鐢?br />聽(tīng)聽(tīng)聽(tīng)聽(tīng)I(yíng)nvalidateRect(
&
m_rectButton,FALSE);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)CPaintDC聽(tīng)dc(
this);聽(tīng)//聽(tīng)鍦ㄨ繖閲岋紝device聽(tīng)context聽(tīng)for聽(tīng)painting

聽(tīng)聽(tīng)聽(tīng)聽(tīng)m_rectButton.DrawButton(&dc);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)Do聽(tīng)not聽(tīng)call聽(tīng)CSplitterWnd::OnPaint()聽(tīng)for聽(tīng)painting聽(tīng)messages

}
鎵浠ワ紝鎴戠寽嫻嬶紝鎵鏈夌敤浜?jiǎn)CPaintDC鐨勫湴鏂癸紝MFC閮戒細(xì)鍔犱竴鍙ワ細(xì)涓嶈璋冪敤鍩虹被鐨勫嚱鏁板暒锝?br />
鍛靛懙錛屼笉鐭ラ亾鎴戣娓呮娌℃湁

flyingxu 2006-05-22 23:39 鍙戣〃璇勮
]]>
鎶婁唬鐮佺Щ妞嶆垚UNICODEhttp://www.shnenglu.com/flyingxu/archive/2006/05/18/7356.htmlflyingxuflyingxuThu, 18 May 2006 08:09:00 GMThttp://www.shnenglu.com/flyingxu/archive/2006/05/18/7356.htmlhttp://www.shnenglu.com/flyingxu/comments/7356.htmlhttp://www.shnenglu.com/flyingxu/archive/2006/05/18/7356.html#Feedback2http://www.shnenglu.com/flyingxu/comments/commentRss/7356.htmlhttp://www.shnenglu.com/flyingxu/services/trackbacks/7356.html 鍔ㄦ満 : 鍦ㄦ病鏈夎涓枃瀛椾綋鐨勬満鍣ㄤ笂鏄劇ず涓枃

濡傛灉涓嶆槸unicode,鏌愪簺涓枃瀛楃浼?xì)鍦ㄤ笉鍚岀?/span>codepage涓婂嚭鐜頒貢鐮?/span>;濡傛灉褰撳墠codepage涓洪煩鏂囨椂,鏌愪簺涓枃瀛椾細(xì)鍙樻垚闊╂枃鐨勬牱瀛?/span>,濂囨?/span>.

Step1: define _UNICODE, undefine _MBCS

瀹忓畾涔?/span>UNICODE, _UNICODE瀹氫箟涓や釜涔熷彲浠?/span>,瀹氫箟涓涓篃鍙互,windows鐨勫ご鏂囦歡浼?xì)淇濊瘉涓や釜閮戒細(xì)琚畾涔?/span>.

#ifdef聽(tīng)_UNICODE
#ifndef聽(tīng)UNICODE
#define 聽(tīng)UNICODE聽(tīng) // 聽(tīng)UNICODE聽(tīng)is聽(tīng)used聽(tīng)by聽(tīng)Windows聽(tīng)headers

#endif
#endif

聽(tīng)
#ifdef聽(tīng)UNICODE
#ifndef聽(tīng)_UNICODE
#define 聽(tīng)_UNICODE聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) // 聽(tīng)_UNICODE聽(tīng)is聽(tīng)used聽(tīng)by聽(tīng)C-runtime/MFC聽(tīng)headers
#endif
#endif

聽(tīng)

Step2: 鏇存敼鍙橀噺綾誨瀷

姣斿 char -> TCHAR

浣嗘槸 ,騫朵笉鏄鎵鏈夌殑char綾誨瀷閮戒笉鑳界敤浜?/span>.濡傛灉闇瑕佺敤,騫朵笖鍑芥暟鐨勫弬鏁?/span>/榪斿洖鍊間粈涔堢殑閮戒笉鍐茬獊,char綾誨瀷榪樻槸鍙互鐢ㄧ殑.

Step3: 鏇存敼甯擱噺瀛楃涓插艦寮?/span>

" abc " -> _T(" abc ")

鍥犱負(fù)寮濮嬪啓紼嬪簭鏃舵病鏈夋敞鎰?/span> ,閫犳垚榪欐牱鐨勫父閲忓瓧絎︿覆褰㈠紡闈炲父澶?/span>,涓涓釜鏀硅搗鏉ュ緢鐑?/span>,鎴戝啓浜?jiǎn)涓獮畯鎻掍?/span>,鍙互璁?/span> 鈥?/span> abc 鈥?/span> 閫変腑鍚庣偣涓涓?/span> button灝辮兘鍙樻垚_T( 鈥?/span> abc 鈥?/span> ),鏈夌偣鐢?/span>,浠g爜涔熼潪甯哥殑鐭?/span>.

Step4: 鏇挎崲鏌愪簺鍑芥暟

姣斿atoi -> _ttoi

鍦ㄨ繖閲岄亣鍒頒竴涓棶棰?/span>,灝辨槸atof鐨勬浛鎹?/span>.

鎸夌収msdn, atof搴旇琚?/span>_ttof鏇挎崲

TCHAR.H routine

_UNICODE & _MBCS not defined

_MBCS defined

_UNICODE defined

_tstof

atof

atof

_wtof

浣嗘槸濂囨殑鏄?/span>,VC6閲岄潰涓嶈璇?/span>_tstof榪欎釜鍑芥暟,VC.net 2003灝卞彲浠?/span>.

鏈変袱涓В鍐崇殑鍔炴硶:

1)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 鍥犱負(fù)atof鍙槸鏇挎崲涓烘誕鐐規(guī)暟,鎵浠ヨ繖閲岀敤WideCharToMultiByte杞寲涓涓嬩箣鍚庡啀璋冪敤atof涔熸槸鍙鐨?/span>

2)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 鍛靛懙,鐢?/span>strtod鐨勬浛鎹㈠嚱鏁?/span>_tcstod,鍝堝搱,褰撶劧鍙傛暟瑕佸彉?shù)竴涓?鎴戣寰楄繖涓柟娉曚笉閿?涓嶈琚玬sdn闄愬埗姝諱簡(jiǎn)

Step5: 媯(gè)鏌ヤ竴涓嬭皟鐢ㄥ叾浠?/span> dll 鐨勬帴鍙e嚱鏁?/span>

鍥犱負(fù)欏圭洰榪樼敤浜?jiǎn)鍙﹀涓涓?/span>dll,鍏朵腑鏈変簺鎺ュ彛闇瑕?/span>char*鍙傛暟,榪欎釜鏃跺欏氨蹇呴』鐢?/span>WideCharToMultiByte杞崲涓涓嬩簡(jiǎn).

VC閲岄潰鐨勮緗?
1) 絳夋妸鎵鏈夌殑緙栬瘧error鏀瑰畬浜?jiǎn)涔嬪悗涓緙栬瘧,闄や簡(jiǎn)涓猯ink閿欒,涓嶈繃msdn鏈夎В閲?
If you are using Unicode and MFC, you will get an unresolved external on _WinMain@16 if you don鈥檛 create an entrypoint to wWinMainCRTStartup. Use the /ENTRY option or type this value in the Project Settings dialog box. (To find this option in the development environment, click Settings on the Project menu, then click the Link tab, and click Output in the Category box.)

2)緇堜簬緙栬瘧鎴愬姛浜?璋冭瘯鐨勬椂鍊欏嵈鍙戠幇CString鐨勫間笉鑳藉湪QuickWatch紿楀彛涓樉紺轟簡(jiǎn)
tools->option->
in the debug tab u can find a check box Labeled "Display unicode strings"
Check it.

闂 : 鐩存帴鐢?/span> ANSI 鐨?/span> dll 涓殑 CString

鍦ㄤ嬌鐢?/span>dll鐨勬椂鍊?/span>,闇瑕佺洿鎺ヤ嬌鐢?/span>dll涓殑涓涓彉閲?/span>,鏄?/span>CString綾誨瀷,鍥犱負(fù)榪欎釜dll榪樻病鏈夋敼涓?/span>unicode,鎵浠ュ湪鐩存帴浣跨敤鍏跺彉閲忔椂鏈夌偣闂,浣垮緱鍊間笉瀵?/span>.(鏄笉鏄繖涓師鍥犺繕娌℃湁瀹屽叏楠岃瘉,搴旇鏄殑)

鍒拌繖閲?/span> , 瀹e竷縐繪澶辮觸 !

/*琛ュ厖錛?br />緇撴灉鏄け璐ワ紝浣嗘槸鍩烘湰縐繪浠g爜鐨勬墍鏈夋楠ら兘鏈変簡(jiǎn)銆傝屼笖錛屼篃鎸囧嚭浜?jiǎn)濡傛灉闇瑕佽皟鐢ㄧ殑dll涓嶆槸unicode錛屾瘡嬈¤皟鐢?浼犻掑弬鏁版椂錛岄兘瑕佽漿鎹紝寰堢儲(chǔ)銆?br />鍚庢潵鎴戞妸dll鐨勪唬鐮佷篃縐繪浜?jiǎn)涓嬪Q岀幇鍦ㄨ繍琛岀殑寰堝ソ錛岄煩鏂囥佷腑鏂囬兘鍙互鏄劇ず錛屼笉綆′綘褰撳墠璇█鏄粈涔堛?br />*/

榪樻湁涓綃囪縐繪姝ラ鐨?鏇村叏闈?閫傚悎鏇村鏉傜殑鎯呭喌:
Cheat Sheet:Unicode-enabling Microsoft C/C++ Source Code (http://www.i18nguy.com/unicode/c-unicode.html)

聽(tīng)



flyingxu 2006-05-18 16:09 鍙戣〃璇勮
]]>
涓涓笉鑳借皟璇旸LL鐨勯棶棰?/title><link>http://www.shnenglu.com/flyingxu/archive/2006/04/17/5754.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Mon, 17 Apr 2006 07:20:00 GMT</pubDate><guid>http://www.shnenglu.com/flyingxu/archive/2006/04/17/5754.html</guid><wfw:comment>http://www.shnenglu.com/flyingxu/comments/5754.html</wfw:comment><comments>http://www.shnenglu.com/flyingxu/archive/2006/04/17/5754.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/flyingxu/comments/commentRss/5754.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/flyingxu/services/trackbacks/5754.html</trackback:ping><description><![CDATA[鏈変袱涓伐紼媁.exe, 鍜宑.dll<br />姣忔鎴戜粠w璋冭瘯c鐨勬椂鍊欓兘鏄彲浠ョ洿鎺ヤ粠w宸ョ▼璁炬柇鐐?璋冭瘯榪涘叆c婧愮爜鐨?c鐨勬簮鐮佹垜鏈?鍦ㄥ彟澶栦竴涓洰褰曚笅.榪欐槸涓垜瑙夊緱寰堝ソ鐨勫姛鑳?<br />緇撴灉鏈変竴澶?鎴戞嫹浜?jiǎn)涓柊鐨刢宸ョ▼,緙栬瘧鍚?鍙戠幇浠巜榪涗笉浜?jiǎn)c浠g爜浜?鍗充嬌鍕夊己榪涘幓浜?灞呯劧涓嶆槸鍋滃湪鍑芥暟鐨勭涓鍙?鑰屾槸鍦ㄦ煇涓驚鐜綋鍐?<br />...<br />...<br />鍚庢潵鐪嬩簡(jiǎn)涓涓?鍘熸潵,鍦╳宸ョ▼鐨刣ebug鐩綍涓?榪樻湁涓猚.lib鍜宑.dll鐨勮佺増鏈?鑰屾柊鐗堢殑c.lib鍜宑.dll鍦╳宸ョ▼鐨勬牴鐩綍涓?鑰岃皟璇曠殑鏃跺?debug鐩綍涓嬬殑dll lib鏄紭鍏堢殑(鐚滄祴)<br />...<br />...<br />鎵浠?鍙槸涓矖蹇?jī)鐨勯棶棰?涓嶆槸鎶鏈棶棰?<img src ="http://www.shnenglu.com/flyingxu/aggbug/5754.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-04-17 15:20 <a href="http://www.shnenglu.com/flyingxu/archive/2006/04/17/5754.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.lepinw.cn" target="_blank">无码8090精品久久一区</a>| <a href="http://www.xhlwd.cn" target="_blank">丁香狠狠色婷婷久久综合</a>| <a href="http://www.ya74.cn" target="_blank">久久精品欧美日韩精品</a>| <a href="http://www.fq2.com.cn" target="_blank">日韩亚洲国产综合久久久</a>| <a href="http://www.888happy.cn" target="_blank">国内精品免费久久影院</a>| <a href="http://www.gcxv.cn" target="_blank">久久93精品国产91久久综合</a>| <a href="http://www.kxblogs.cn" target="_blank">99久久精品免费观看国产</a>| <a href="http://www.vdmo.cn" target="_blank">国产L精品国产亚洲区久久</a>| <a href="http://www.debtee.cn" target="_blank">伊人久久大香线蕉精品</a>| <a href="http://www.ds361.cn" target="_blank">天天久久狠狠色综合</a>| <a href="http://www.girla.cn" target="_blank">国产精品99久久久久久www</a>| <a href="http://www.adultr.cn" target="_blank">久久精品国产亚洲精品</a>| <a href="http://www.czqxj.cn" target="_blank">欧美日韩中文字幕久久久不卡</a>| <a href="http://www.qlong.net.cn" target="_blank">久久久久国产精品麻豆AR影院 </a>| <a href="http://www.wuhujob.com.cn" target="_blank">亚洲日韩中文无码久久</a>| <a href="http://www.spbbs.cn" target="_blank">久久久久久久久久久久久久</a>| <a href="http://www.fd-tex.cn" target="_blank">怡红院日本一道日本久久 </a>| <a href="http://www.jl893.com.cn" target="_blank">久久精品www人人爽人人</a>| <a href="http://www.stwyy.cn" target="_blank">欧美丰满熟妇BBB久久久</a>| <a href="http://www.qfzxd.cn" target="_blank">国产精品99久久99久久久</a>| <a href="http://www.hydqgs.cn" target="_blank">青青青国产精品国产精品久久久久</a>| <a href="http://www.hhlou.com.cn" target="_blank">久久精品这里热有精品</a>| <a href="http://www.gzjrbs.cn" target="_blank">久久久久久久久久久免费精品</a>| <a href="http://www.mir802.cn" target="_blank">久久久久久久久66精品片</a>| <a href="http://www.gyvgllqc.cn" target="_blank">久久香综合精品久久伊人</a>| <a href="http://www.tongshuntaoci.cn" target="_blank">国产精品99久久免费观看</a>| <a href="http://www.bitpter.cn" target="_blank">久久久久久国产精品无码下载</a>| <a href="http://www.818jk.cn" target="_blank">国产亚洲美女精品久久久2020</a>| <a href="http://www.x3077.cn" target="_blank">久久精品国产99国产精品澳门 </a>| <a href="http://www.8812345.com.cn" target="_blank">99久久久国产精品免费无卡顿</a>| <a href="http://www.kuruishanghai.cn" target="_blank">久久精品一区二区三区不卡</a>| <a href="http://www.ai385.cn" target="_blank">久久综合伊人77777</a>| <a href="http://www.rolanskin.cn" target="_blank">久久久久亚洲av无码专区导航</a>| <a href="http://www.animin.cn" target="_blank">91精品观看91久久久久久</a>| <a href="http://www.swd5.cn" target="_blank">久久午夜夜伦鲁鲁片免费无码影视</a>| <a href="http://www.jhitezpt.cn" target="_blank">久久精品国产亚洲AV无码娇色 </a>| <a href="http://www.icxun.cn" target="_blank">精品久久久久久无码不卡</a>| <a href="http://www.pw823.cn" target="_blank">99精品久久精品</a>| <a href="http://www.sunmuying.cn" target="_blank">国产精品亚洲综合久久</a>| <a href="http://www.jupucha.com.cn" target="_blank">久久综合久久综合九色</a>| <a href="http://www.xahyjtls.cn" target="_blank">久久精品国产99国产精品亚洲</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>