锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品第一区二区,欧美涩涩视频,欧美亚洲日本一区http://m.shnenglu.com/flyingxu/category/824.htmlto get ready...zh-cnWed, 21 May 2008 20:10:07 GMTWed, 21 May 2008 20:10:07 GMT60鎴戠殑鏂板崥瀹㈠湪 http://www.codediscuss.comhttp://m.shnenglu.com/flyingxu/archive/2007/10/02/33321.htmlflyingxuflyingxuTue, 02 Oct 2007 06:23:00 GMThttp://m.shnenglu.com/flyingxu/archive/2007/10/02/33321.htmlhttp://m.shnenglu.com/flyingxu/comments/33321.htmlhttp://m.shnenglu.com/flyingxu/archive/2007/10/02/33321.html#Feedback1http://m.shnenglu.com/flyingxu/comments/commentRss/33321.htmlhttp://m.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 鍙戣〃璇勮
]]>
Memory leak in CWinThread?http://m.shnenglu.com/flyingxu/archive/2006/07/26/10557.htmlflyingxuflyingxuWed, 26 Jul 2006 11:11:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/07/26/10557.htmlhttp://m.shnenglu.com/flyingxu/comments/10557.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/07/26/10557.html#Feedback3http://m.shnenglu.com/flyingxu/comments/commentRss/10557.htmlhttp://m.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杈撳嚭鐨勫吀鍨嬫彁紺轟負錛?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喅鏂規硶錛?br />step 1)
鍦ㄧ嚎紼嬪嚱鏁頒腑錛岃寰楀啓AfxEndThread();(涓嶢fxBeginThread瀵瑰簲錛屽叾浠栫殑寮濮嬬嚎紼嬬殑鍑芥暟錛屾湁鐩稿簲鐨勫嚱鏁?
step 2)
鐢?:WaitForSingleObject()紜繚綰跨▼褰誨簳閫鍑?br />
step 2鏄瘮杈冨鏄撳拷鐣ョ殑錛岀敤sleep鍑芥暟鍙兘渚ュ垢鐨勪繚璇佺嚎紼嬮鍑猴紝浣嗕笉鑳界‘淇濄?img src ="http://m.shnenglu.com/flyingxu/aggbug/10557.html" width = "1" height = "1" />

flyingxu 2006-07-26 19:11 鍙戣〃璇勮
]]>
鍐嶈皟璇曠姸鎬佷笅錛屾寜涓婩12錛岀▼搴忓氨鍑洪敊浜嗭紙VC錛?/title><link>http://m.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://m.shnenglu.com/flyingxu/archive/2006/07/13/9818.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/9818.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/07/13/9818.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/9818.html</wfw:commentRss><trackback:ping>http://m.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://m.shnenglu.com/flyingxu/aggbug/9818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-07-13 18:29 <a href="http://m.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://m.shnenglu.com/flyingxu/archive/2006/07/11/9697.htmlflyingxuflyingxuTue, 11 Jul 2006 11:14:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/07/11/9697.htmlhttp://m.shnenglu.com/flyingxu/comments/9697.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/07/11/9697.html#Feedback3http://m.shnenglu.com/flyingxu/comments/commentRss/9697.htmlhttp://m.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涓嶈鍑鴻繖鏍風殑閿欑殑

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

Q : MFC榪斿洖鐨勪復鏃跺璞℃寚閽堟垚鍥?
涓昏瑙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竴瀹氬湪鏌愮鎯呭喌涓嬩笉鏄復鏃剁殑錛岄珮鎵嬭兘涓嶈兘瑙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浼氶噴鏀総emporary 聽maps. 聽

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

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

涓存椂鍖呰瀵硅薄浼氬湪絀洪棽鏃墮棿鍒犻櫎.鍦ㄥ悓涓鍑芥暟涓嬈′嬌鐢ㄦ槸娌$敤闂鐨?涓嶅悓鍑芥暟涓嬌鐢ㄥ厛鍓嶄繚瀛樹笅鏉ョ殑鎸囬拡灝辨湁鍙兘鍑洪敊,鐗瑰埆鏄璇濇鍒濅嬌鍖栨椂鍊欏瓨涓嬫潵鐨勬寚閽? 聽
聽 聽 聽 聽鍦∕FC灞傛涓婄殑鍑芥暟浣跨敤CWnd瀵硅薄,鑰屾湰鍦癢indows浠g爜(API)浣跨敤鍙ユ焺.濡?褰揥indows緋葷粺璋冪敤涓涓獥鍙h繃紼嬫椂灝嗕紶閫掍竴涓狧WND鍙傛暟,鑰孧FC鏈韓鐨勬秷鎭満鍒朵嬌鐢–Wnd綾?涓轟簡鏇村ソ鏇撮珮鏁堢殑瀹炵幇,MFC闇瑕佷笌Windows緋葷粺鍚堜綔,灝嗗彞鏌勪笌CWnd瀵硅薄榪涜鍏寵仈---瀹冪敤CHandleMap瀹屾垚鍏寵仈. 聽
CHandleMap鏈変袱涓狢MapPtrToPtr鐨勬垚鍛樺彉閲?m_permanentMap(姘鎬箙鏄犲皠琛?紼嬪簭榪愯榪囩▼涓璞?鍙ユ焺涔嬮棿鐨勫叧緋?,m_temporaryMap(涓存椂鏄犲皠琛?鍦ㄦ秷鎭瓨鍦ㄧ殑榪囩▼涓墠瀛樺湪).姘鎬箙琛ㄤ繚瀛樻樉寮忓垱寤虹殑CWnd瀵硅薄,褰撳璞″垱寤烘椂灝嗗湪姘鎬箙鐩綍涓嬫彃鍏ヤ竴涓潯鐩?鍦–Wnd::OnNcDestrory鏃跺垹闄ゅ搴旀潯鐩?浣嗘槸Windows鏈夋椂浼氫紶鍏ユ煇浜涗笉鏄敱寮鍙戜漢鍛樻樉寮忓垱寤虹殑紿楀彛鐨勫彞鏌?姝ゆ椂MFC浼氬垎閰嶄竴涓復鏃跺璞℃潵鍖呰榪欎釜鍙ユ焺騫跺皢瀹冧滑鐨勬槧灝勪繚瀛樺埌涓存椂鏄犲皠琛ㄤ腑,榪欎簺涓存椂瀵硅薄浼氬湪絀洪棽鏃墮棿琚垹闄ゅ茍縐昏蛋鐩稿簲鐨勪復鏃舵槧灝勮〃鏉$洰.綾諱技鐨凪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媯鏌ヤ復鏃惰〃,閮戒笉瀛樺湪鏃?浣跨敤pTemp 聽= 聽= 聽m_pClass->CreateObject();if 聽(pTemp 聽== 聽NULL)AfxThrowMemoryException();m_temporaryMap.SetAt((LPVOID)h, 聽pTemp);鍒涘緩涓存椂瀵硅薄騫跺皢鍏舵彃鍏ュ埌涓存椂琛ㄤ腑鍘?鍚屾椂榪斿洖璇ヤ復鏃跺璞? 聽
void 聽CHandleMap::RemoveHandle(HANDLE 聽h)鐨勬敞閲婅鏄庝復鏃跺璞″皢鍦ㄧ┖闂叉椂鐢監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://m.shnenglu.com/flyingxu/archive/2006/07/09/9593.htmlflyingxuflyingxuSat, 08 Jul 2006 18:03:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/07/09/9593.htmlhttp://m.shnenglu.com/flyingxu/comments/9593.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/07/09/9593.html#Feedback1http://m.shnenglu.com/flyingxu/comments/commentRss/9593.htmlhttp://m.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錛堬級鐨勭‘鏄釜鏈夌偣澶嶆潅鐨勯棶棰橈紝鎴戝彲鑳借繕浼氬啓鍑犵瘒鏂囩珷 錛氾級
榪欓噷錛?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 鐨勪竴涓簲鐢細鍦ㄧ▼搴忚繍琛屽悗鍐嶈繘鍏ヨ皟璇曞櫒http://m.shnenglu.com/flyingxu/archive/2006/07/06/9493.htmlflyingxuflyingxuThu, 06 Jul 2006 09:35:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/07/06/9493.htmlhttp://m.shnenglu.com/flyingxu/comments/9493.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/07/06/9493.html#Feedback8http://m.shnenglu.com/flyingxu/comments/commentRss/9493.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/9493.html1錛夊惎鍔ㄨ皟璇曞櫒錛屾瘮濡俈C
2錛夊湪VC涓鏂偣
3錛夋搷浣滅▼搴忥紝浣垮緱紼嬪簭榪愯鍒版柇鐐癸紝鍋滀笅鏉?br />浣嗘槸鐜板湪鎴戦亣鍒頒竴涓儏鍐碉紝甯屾湜璋冭瘯鐨勬儏鏅槸榪欐牱鐨勶細鍙屽嚮鏌愪釜鏂囦歡錛屾垜鐨勭▼搴忓惎鍔ㄥ悗錛岃繖涓椂鍊欐垜鎯崇▼搴忓仠涓嬫潵錛岃鎴戝湪VC涓皟璇曞畠銆?br />浣嗘槸錛屽弻鍑繪枃浠跺悗鍚姩鐨勭▼搴忥紝鏄釜鐙珛鐨別xe榪愯紼嬪簭錛岃偗瀹氫笉鏄湪VC鐨勮繍琛屾帶鍒朵笅鐨勶紝VC涓緗殑鏂偣涓嶈搗浣滅敤鐨勩傛庝箞鍔炲憿錛?br />榪欎釜鏃跺欏彲浠ュ湪鎯寵紼嬪簭鍋滀笅鏉ョ殑鍦版柟澧炲姞鎸囦護_asm int 3錛宒ebug涓嬬紪璇戝ソ銆傚弻鍑繪枃浠跺悗榪愯榪欎釜exe錛屽湪exe榪愯鍒癬asm int 3鏃訛紝灝變細涓柇錛岃屾妸褰撳墠鐨別xe榪愯涓庝竴涓柊鐨勮皟璇曞櫒錛堜竴涓柊鐨刅C榪涚▼錛夌粨鍚堣搗鏉ャ傛帴涓嬫潵灝卞儚涓鑸殑璋冭瘯浜嗐?br />榪欐椂鐨勮皟璇曟楠ょ被浼間笌錛?br />1錛夌▼搴忚繍琛?br />2錛夐亣鍒扮壒瀹氭潯浠舵椂錛宊asm int 3鎶婂綋鍓峞xe涓庝竴涓柊鐨勮皟璇曞櫒錛屾瘮濡備竴涓柊鐨刅C榪涚▼錛岃仈緋昏搗鏉?br />3錛夊湪璋冭瘯鍣ㄤ腑璋冭瘯exe

錛氾級

flyingxu 2006-07-06 17:35 鍙戣〃璇勮
]]>
ANSI鐗堟湰淇濆瓨鐨勬枃浠訛紝鍦║NICODE鏃舵槸鍚︿緷鐒惰兘璇誨叆錛?/title><link>http://m.shnenglu.com/flyingxu/archive/2006/06/13/8521.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Tue, 13 Jun 2006 15:53:00 GMT</pubDate><guid>http://m.shnenglu.com/flyingxu/archive/2006/06/13/8521.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/8521.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/06/13/8521.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/8521.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/flyingxu/services/trackbacks/8521.html</trackback:ping><description><![CDATA[鎯呭喌鏄繖鏍風殑錛屼竴涓▼搴忎粠ansi縐繪鍒頒簡unicode錛岃<a id="viewpost1_TitleUrl" href="/flyingxu/archive/2006/05/18/7356.html"><font color="#000080">鎶婁唬鐮佺Щ妞嶆垚UNICODE</font></a> 錛?a href="/flyingxu/archive/2006/05/18/7356.html">http://m.shnenglu.com/flyingxu/archive/2006/05/18/7356.html</a>錛夛紝涔嬪悗浜х敓浜嗕竴涓棶棰橈紝涔嬪墠鏂囦歡淇濆瓨鐨勯偅浜涙枃浠訛紝unicode鐗堟湰榪樿兘鎵撳紑鍚楋紵榪欑湡鏄釜澶ч棶棰橈紝濡傛灉涓嶈兘錛屽氨鍩烘湰琛ㄧず榪欎釜紼嬪簭宸茬粡鍗婃涓嶆椿浜嗐?br /><br />鏂囦歡鐨勪繚瀛樺熀鏈敤鐨勫簭鍒楀寲錛屾瘮濡?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: #0000ff">void</span><span style="COLOR: #000000">聽CSDITestDoc::Serialize(CArchive</span><span style="COLOR: #000000">&</span></font><font face="Courier New"><span style="COLOR: #000000">聽ar)<br />{<br />聽聽聽聽</span><span style="COLOR: #0000ff">if</span></font><font face="Courier New"><span style="COLOR: #000000">聽(ar.IsStoring())<br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽TODO:聽add聽storing聽code聽here</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span></font><font face="Courier New"><span style="COLOR: #000000">聽m_strName;<br />聽聽聽聽}<br />聽聽聽聽</span><span style="COLOR: #0000ff">else</span></font><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽{<br />聽聽聽聽聽聽聽聽</font></span><font face="Courier New"><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽TODO:聽add聽loading聽code聽here</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000">>></span></font><span style="COLOR: #000000"><font face="Courier New">聽m_strName;<br />聽聽聽聽}<br />}</font></span></div><font face="Courier New">濡傛灉m_strName = _T("name");閭d箞ansi鎯呭喌涓嬶紝淇濆瓨鐨勬枃浠朵負:<br />04 6E 61 6D 65錛屼竴鍏?涓瓧鑺傘?br />鐒跺悗鐢╱nicode鐗堟湰淇濆瓨鏃訛紝鏄?br />FF FE FF 04 6E 00 61 00 6D 00 65 00,涓鍏?2涓瓧鑺傘?br /><br />鐒跺悗鎴戝彂鐜幫紝ansi鐗堟湰鐨勫彲浠ユ墦寮unicode鐗堟湰鐨勬枃浠訛紝unicode鐗堟湰鐨勪篃鍙互鎵撳紑ansi鐗堟湰鐨勬枃浠躲?br /><br />涓轟粈涔堬紵鎴戣寰楀叧閿湪浜嶤String錛屾垜瑙夊緱CString鍔熻兘姣旇緝寮哄ぇ銆?br />CString鐨勫簭鍒楀寲鍑芥暟<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">聽CString聽serialization聽code<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽String聽format:<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽聽聽聽聽聽UNICODE聽strings聽are聽always聽prefixed聽by聽0xff,聽0xfffe<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽聽聽聽聽聽if聽<聽0xff聽chars:聽len:BYTE,聽TCHAR聽chars<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽聽聽聽聽聽if聽>=聽0xff聽characters:聽0xff,聽len:WORD,聽TCHAR聽chars<br /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽聽聽聽聽聽if聽>=聽0xfffe聽characters:聽0xff,聽0xffff,聽len:DWORD,聽TCHARs</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000"><br />CArchive</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽AFXAPI聽</span><span style="COLOR: #0000ff">operator</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">(CArchive</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽ar,聽</span><span style="COLOR: #0000ff">const</span><span style="COLOR: #000000">聽CString</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">)<br />{<br />聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽special聽signature聽to聽recognize聽unicode聽strings</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #000000">#ifdef聽_UNICODE<br />聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(BYTE)</span><span style="COLOR: #000000">0xff</span><span style="COLOR: #000000">;<br />聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(WORD)</span><span style="COLOR: #000000">0xfffe</span><span style="COLOR: #000000">;<br /></span><span style="COLOR: #0000ff">#endif</span><span style="COLOR: #000000"><br /><br />聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">255</span><span style="COLOR: #000000">)<br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(BYTE)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength;<br />聽聽聽聽}<br />聽聽聽聽</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength聽</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0xfffe</span><span style="COLOR: #000000">)<br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(BYTE)</span><span style="COLOR: #000000">0xff</span><span style="COLOR: #000000">;<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(WORD)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength;<br />聽聽聽聽}<br />聽聽聽聽</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(BYTE)</span><span style="COLOR: #000000">0xff</span><span style="COLOR: #000000">;<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(WORD)</span><span style="COLOR: #000000">0xffff</span><span style="COLOR: #000000">;<br />聽聽聽聽聽聽聽聽ar聽</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(DWORD)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength;<br />聽聽聽聽}<br />聽聽聽聽ar.Write(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.m_pchData,聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetData()</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">nDataLength</span><span style="COLOR: #000000">*</span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000">(TCHAR));<br />聽聽聽聽</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽ar;<br />}<br /></span></div></font>瀹冨unicode鍋氫簡鐗瑰埆鐨勬敮鎸?br />鐗瑰埆鏄綋瀹冨湪璇誨簭鍒楀寲榪囩▼鐨勬椂鍊?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: #000000">CArchive</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽AFXAPI聽</span><span style="COLOR: #0000ff">operator</span><span style="COLOR: #000000">>></span><span style="COLOR: #000000">(CArchive</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽ar,聽CString</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">string</span></font><font face="Courier New"><span style="COLOR: #000000">)<br />{<br />#ifdef聽_UNICODE<br />聽聽聽聽</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽nConvert聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">;聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽if聽we聽get聽ANSI,聽convert</span></font><span style="COLOR: #008000"><br /></span><span style="COLOR: #0000ff"><font face="Courier New">#else</font></span><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽</font></span><font face="Courier New"><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽nConvert聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽if聽we聽get聽UNICODE,聽convert</span></font><span style="COLOR: #008000"><br /></span><span style="COLOR: #0000ff"><font face="Courier New">#endif</font></span><span style="COLOR: #000000"><br /><br /><font face="Courier New">聽聽聽聽UINT聽nNewLen聽</font></span><span style="COLOR: #000000"><font face="Courier New">=</font></span><font face="Courier New"><span style="COLOR: #000000">聽_AfxReadStringLength(ar);<br />聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(nNewLen聽</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">聽(UINT)</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span></font><font face="Courier New"><span style="COLOR: #000000">)<br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽nConvert聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">-</span></font><font face="Courier New"><span style="COLOR: #000000">聽nConvert;<br />聽聽聽聽聽聽聽聽nNewLen聽</span><span style="COLOR: #000000">=</span></font><font face="Courier New"><span style="COLOR: #000000">聽_AfxReadStringLength(ar);<br />聽聽聽聽聽聽聽聽ASSERT(nNewLen聽</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">1</span></font><font face="Courier New"><span style="COLOR: #000000">);<br />聽聽聽聽}<br /><br />聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽set聽length聽of聽string聽to聽new聽length</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽UINT聽nByteLen聽</span><span style="COLOR: #000000">=</span></font><font face="Courier New"><span style="COLOR: #000000">聽nNewLen;<br />#ifdef聽_UNICODE<br />聽聽聽聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetBufferSetLength((</span><span style="COLOR: #0000ff">int</span></font><font face="Courier New"><span style="COLOR: #000000">)nNewLen);<br />聽聽聽聽nByteLen聽</span><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">聽nByteLen聽</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(</span><span style="COLOR: #000000">1</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">-</span><span style="COLOR: #000000">聽nConvert);聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽bytes聽to聽read</span></font><span style="COLOR: #008000"><br /></span><span style="COLOR: #0000ff"><font face="Courier New">#else</font></span><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽nByteLen聽</font></span><font face="Courier New"><span style="COLOR: #000000">+=</span><span style="COLOR: #000000">聽nByteLen聽</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽nConvert;聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽bytes聽to聽read</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(nNewLen聽</span><span style="COLOR: #000000">==</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">)<br />聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetBufferSetLength(</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">);<br />聽聽聽聽</span><span style="COLOR: #0000ff">else</span></font><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽聽聽聽聽</font></span><font face="Courier New"><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.GetBufferSetLength((</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">)nByteLen</span><span style="COLOR: #000000">+</span></font><font face="Courier New"><span style="COLOR: #000000">nConvert);<br /></span><span style="COLOR: #0000ff">#endif</span></font><span style="COLOR: #000000"><br /><br /><font face="Courier New">聽聽聽聽</font></span><font face="Courier New"><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽read聽in聽the聽characters</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(nNewLen聽</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">)<br />聽聽聽聽{<br />聽聽聽聽聽聽聽聽ASSERT(nByteLen聽</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">);<br /><br />聽聽聽聽聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽read聽new聽data</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(ar.Read(</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.m_pchData,聽nByteLen)聽</span><span style="COLOR: #000000">!=</span></font><font face="Courier New"><span style="COLOR: #000000">聽nByteLen)<br />聽聽聽聽聽聽聽聽聽聽聽聽AfxThrowArchiveException(CArchiveException::endOfFile);<br /><br />聽聽聽聽聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽convert聽the聽data聽if聽as聽necessary</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">聽(nConvert聽</span><span style="COLOR: #000000">!=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">)<br />聽聽聽聽聽聽聽聽{<br />#ifdef聽_UNICODE<br />聽聽聽聽聽聽聽聽聽聽聽聽CStringData</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽pOldData聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">string</span></font><font face="Courier New"><span style="COLOR: #000000">.GetData();<br />聽聽聽聽聽聽聽聽聽聽聽聽LPSTR聽lpsz聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(LPSTR)</span><span style="COLOR: #0000ff">string</span></font><font face="Courier New"><span style="COLOR: #000000">.m_pchData;<br /></span><span style="COLOR: #0000ff">#else</span></font><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽聽聽聽聽聽聽聽聽CStringData</font></span><font face="Courier New"><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽pOldData聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #0000ff">string</span></font><font face="Courier New"><span style="COLOR: #000000">.GetData();<br />聽聽聽聽聽聽聽聽聽聽聽聽LPWSTR聽lpsz聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(LPWSTR)</span><span style="COLOR: #0000ff">string</span></font><font face="Courier New"><span style="COLOR: #000000">.m_pchData;<br /></span><span style="COLOR: #0000ff">#endif</span></font><span style="COLOR: #000000"><br /><font face="Courier New">聽聽聽聽聽聽聽聽聽聽聽聽lpsz[nNewLen]聽</font></span><font face="Courier New"><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">\0</span><span style="COLOR: #000000">'</span><span style="COLOR: #000000">;聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽must聽be聽NUL聽terminated</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">.Init();聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽don't聽delete聽the聽old聽data</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽lpsz;聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽convert聽with聽operator=(LPWCSTR)</span></font><span style="COLOR: #008000"><br /></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽聽聽聽聽CString::FreeData(pOldData);<br />聽聽聽聽聽聽聽聽}<br />聽聽聽聽}<br />聽聽聽聽</span><span style="COLOR: #0000ff">return</span></font><span style="COLOR: #000000"><font face="Courier New">聽ar;<br />}<br /></font></span></div>涔熷氨鏄錛屼笉綆′綘淇濆瓨鐨勬枃浠舵槸涓嶆槸unicode錛岄兘鍙互璇昏繘鏉ワ紝杞崲縐板綋鍓島nicode鎴栬卆nsi鐗堟湰<br /><br />涓嶈繃鍥炲埌鏂囩珷鐨勬爣棰橈紝榪欓噷鍙浜嗙敤CString搴忓垪鍖栫殑淇濆瓨銆傚鏋滄槸鍏朵粬淇濆瓨鏂瑰紡錛屽彲浠ュ鐫CString鐨勫仛娉曪紝鍐欏嚱鏁版妸鏂囦歡鎬繪槸鑳借榪涙潵銆?img src ="http://m.shnenglu.com/flyingxu/aggbug/8521.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-06-13 23:53 <a href="http://m.shnenglu.com/flyingxu/archive/2006/06/13/8521.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MFC紼嬪簭涓紝鑷畾涔夌殑瀛楃涓瞚d鑼冨洿鏄粈涔堬紵http://m.shnenglu.com/flyingxu/archive/2006/06/13/8478.htmlflyingxuflyingxuMon, 12 Jun 2006 16:25:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/06/13/8478.htmlhttp://m.shnenglu.com/flyingxu/comments/8478.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/06/13/8478.html#Feedback0http://m.shnenglu.com/flyingxu/comments/commentRss/8478.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/8478.html浠婂ぉ鍚屼簨闂垜銆?br />
鎴戣繕鐪熶笉鐭ラ亾錛屼絾鏄垜鐪嬩簡涓婣FXRES.RC 鍜孉FXRES.H 錛屽彂鐜癕FC鐢ㄧ殑ID閮芥槸0xE000浠ヤ笂鐨勩傛墍浠ワ紝鐢ㄦ埛鑷繁鐢ㄧ殑錛屼粠0錛?gt;0xCFFFF錛熶笉榪囦笉紜畾銆傚懙鍛碉紝鏌ヤ簡涓涓嬶紝姝g‘鐨勫彲浠ヨTN020:http://msdn2.microsoft.com/en-us/library/t2zechd4.aspx
By聽convention,聽the聽ID聽value聽of聽0is聽not聽used.

Windows聽implementation聽limitations聽restrict聽
true聽resource聽IDs聽to聽be聽less聽than聽or聽equal聽to聽0x7FFF.

MFC
's聽internal聽framework聽implementations聽reserve聽several聽ranges:聽0xE000->0xEFFF聽and聽0x7000->0x7FFF.

Several聽Windows聽system聽commands聽use聽the聽range聽of聽
0xF000->0xFFFF.

Control聽IDs聽of聽
1->7聽are聽reserved聽by聽IDOK,聽IDCANCEL,聽and聽so聽on.

The聽range聽of聽
0x8000->0xFFFFfor聽strings聽is聽reserved聽for聽menu聽prompts聽for聽commands.


浣嗘槸鍦ㄦ垜鐨勫嵃璞′腑錛岄噸澶嶇殑瀛楃涓瞚d鍦ㄧ紪璇戠殑鏃跺欙紝灝變細鍑洪敊鐨勩備絾鏄?a >http://support.microsoft.com/kb/q194299/涓婅錛屽疄闄呬笂錛岄?strong>static link mfc鎵嶄細鍦ㄧ紪璇戠殑鏃跺欏彂鐜幫紝鍚﹀垯鍙戠幇涓嶄簡銆?br />
鍙﹀錛?a >http://www.vckbase.com/article/misc/0022.htm涓錛屽湪涓涓猺c鏂囦歡涓紝鍙互鍚屾椂鏈夊嚑縐嶈璦鐨勮祫婧愶紝鍛靛懙錛屾垜鍙戠幇鎴戝偦浜嗭紝姣忔鎶婁笉鍚岃璦鐨勮祫婧愬彂鍦ㄤ笉鍚岀殑rc涓紝鎼炲緱鐜板湪濂藉嚑涓猺c鏂囦歡錛屾瘡嬈℃嫹璐濆垏鎹㈢儲鐨勮姝?img src ="http://m.shnenglu.com/flyingxu/aggbug/8478.html" width = "1" height = "1" />

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

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

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

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

聽聽聽聽m_rectButton.DrawButton(&dc);
}
緇撴灉鎴戞坊鍔犵殑涓滆タ鎬庝箞涔熶笉浼氳鐢誨嚭鏉ワ紝涓轟粈涔堜細榪欐牱錛?br />

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

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

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

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

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

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

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

濡傛灉涓嶆槸unicode,鏌愪簺涓枃瀛楃浼氬湪涓嶅悓鐨?/span>codepage涓婂嚭鐜頒貢鐮?/span>;濡傛灉褰撳墠codepage涓洪煩鏂囨椂,鏌愪簺涓枃瀛椾細鍙樻垚闊╂枃鐨勬牱瀛?/span>,濂囨?/span>.

Step1: define _UNICODE, undefine _MBCS

瀹忓畾涔?/span>UNICODE, _UNICODE瀹氫箟涓や釜涔熷彲浠?/span>,瀹氫箟涓涓篃鍙互,windows鐨勫ご鏂囦歡浼氫繚璇佷袱涓兘浼氳瀹氫箟.

#ifdef聽_UNICODE
#ifndef聽UNICODE
#define 聽UNICODE聽 // 聽UNICODE聽is聽used聽by聽Windows聽headers

#endif
#endif


#ifdef聽UNICODE
#ifndef聽_UNICODE
#define 聽_UNICODE聽聽聽聽聽聽聽聽 // 聽_UNICODE聽is聽used聽by聽C-runtime/MFC聽headers
#endif
#endif

Step2: 鏇存敼鍙橀噺綾誨瀷

姣斿 char -> TCHAR

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

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

" abc " -> _T(" abc ")

鍥犱負寮濮嬪啓紼嬪簭鏃舵病鏈夋敞鎰?/span> ,閫犳垚榪欐牱鐨勫父閲忓瓧絎︿覆褰㈠紡闈炲父澶?/span>,涓涓釜鏀硅搗鏉ュ緢鐑?/span>,鎴戝啓浜嗕釜灝忔彃浠?/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)聽聽聽聽聽 鍥犱負atof鍙槸鏇挎崲涓烘誕鐐規暟,鎵浠ヨ繖閲岀敤WideCharToMultiByte杞寲涓涓嬩箣鍚庡啀璋冪敤atof涔熸槸鍙鐨?/span>

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

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

鍥犱負欏圭洰榪樼敤浜嗗彟澶栦竴涓?/span>dll,鍏朵腑鏈変簺鎺ュ彛闇瑕?/span>char*鍙傛暟,榪欎釜鏃跺欏氨蹇呴』鐢?/span>WideCharToMultiByte杞崲涓涓嬩簡.

VC閲岄潰鐨勮緗?
1) 絳夋妸鎵鏈夌殑緙栬瘧error鏀瑰畬浜嗕箣鍚庝竴緙栬瘧,闄や簡涓猯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紿楀彛涓樉紺轟簡
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綾誨瀷,鍥犱負榪欎釜dll榪樻病鏈夋敼涓?/span>unicode,鎵浠ュ湪鐩存帴浣跨敤鍏跺彉閲忔椂鏈夌偣闂,浣垮緱鍊間笉瀵?/span>.(鏄笉鏄繖涓師鍥犺繕娌℃湁瀹屽叏楠岃瘉,搴旇鏄殑)

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

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

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



flyingxu 2006-05-18 16:09 鍙戣〃璇勮
]]>
灝介噺鐢ㄤ唬鐮佹潵鏇夸唬璧勬簮涓殑灞炴?/title><link>http://m.shnenglu.com/flyingxu/archive/2006/05/17/7299.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Wed, 17 May 2006 06:17:00 GMT</pubDate><guid>http://m.shnenglu.com/flyingxu/archive/2006/05/17/7299.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/7299.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/05/17/7299.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/7299.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/flyingxu/services/trackbacks/7299.html</trackback:ping><description><![CDATA[璧勬簮涓殑灞炴?鏄寚鍐橫FC紼嬪簭鏃禫C IDE鐨剅esource緙栬緫鍣ㄤ腑鍙互璁懼畾鐨勫悇縐嶅睘鎬?姣斿<font face="Courier New">WS_EX_TRANSPARENT</font>鎴栬?font face="Courier New">LVS_REPORT</font>.<br />鑰岃繖浜涘睘鎬?閮芥槸鍙互鐢ㄤ唬鐮佸湪紼嬪簭鍒濆鍖栧悗鍔犱笂鍘葷殑,姣斿鍦?font face="Courier New">OnInitDialog()</font> 鎴栬?font face="Courier New">OnCreate()</font>鍑芥暟涓?<br /><br />浠庢柟渚挎ф潵璇?鑲畾鏄湪璧勬簮涓緗繖浜涘睘鎬ф洿鍔犳柟渚?浣嗘槸..<br />鎴戦亣鍒頒竴縐嶆儏鍐?鍦ㄦ垜鐨勭▼搴忎腑,鏈変袱涓猺c鏂囦歡,鍒嗗埆鏄腑鏂囧拰鑻辨枃,榪欎釜鏃跺?灝卞彂鐢熶簡鍦ㄨ嫳鏂囪祫婧愪腑璁劇疆浜嗗睘鎬т慨姝d簡涓涓猙ug浣嗘槸鍦ㄤ腑鏂囩増鐨勮祫婧愪腑蹇樿璁劇疆,bug渚濈劧瀛樺湪.鑰屽鏋滄槸鍦ㄥ湪浠g爜涓姞涓婄被浼肩殑浠g爜:<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: #000000">m_CrossRefTab.ModifyStyleEx(</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,WS_EX_TRANSPARENT);</span></font></div>璧勬簮鏂囦歡涓嶇敤鏀瑰彉,鑰屼笖淇浜嗘墍鏈夌殑闂.<br /><br />鎵浠?鎴戣寰?搴旇灝介噺鐢ㄥ嚑琛屼唬鐮佹潵鏇夸唬鍦ㄨ祫婧愪腑鐨勮瀹氬睘鎬?img src ="http://m.shnenglu.com/flyingxu/aggbug/7299.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-05-17 14:17 <a href="http://m.shnenglu.com/flyingxu/archive/2006/05/17/7299.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍐欎簡涓緢灝忕殑杞歡錛屽揩閫熷垏鎹㈤紶鏍囧乏閿?鍙抽敭http://m.shnenglu.com/flyingxu/archive/2006/05/11/6975.htmlflyingxuflyingxuThu, 11 May 2006 14:33:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/05/11/6975.htmlhttp://m.shnenglu.com/flyingxu/comments/6975.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/05/11/6975.html#Feedback2http://m.shnenglu.com/flyingxu/comments/commentRss/6975.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/6975.html榧犳爣鐢ㄤ箙浜嗭紝瀹規槗鑲╄唨鐤鹼紝鎵浠ユ湁鏃跺欒鎹㈠埌宸﹁竟錛岀劧鍚庨渶瑕佺殑鏃跺欙紝鍐嶆崲鍒板彸杈廣傛瘡嬈″埌鎺у埗闈㈡澘閲屾敼榪樿洰鐑︾殑銆?/p>

鐜板湪濂戒簡錛岃嚜宸卞啓浜嗕釜紼嬪簭錛屽揩閫熷垏鎹細褰撳墠鏄彸鎵嬩範鎯氨鎹㈠埌宸︽墜涔犳儻錛涘弽涔嬫崲鍒板彸鎵嬩範鎯?br />紼嬪簭寰堝皬錛屽彧鏈?琛屼唬鐮侊細

int 聽APIENTRY聽WinMain(HINSTANCE聽hInstance,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽HINSTANCE聽hPrevInstance,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽LPSTR聽聽聽聽聽lpCmdLine,
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
int
聽聽聽聽聽聽聽nCmdShow)
{
聽聽聽聽聽
// 聽TODO:聽Place聽code聽here.

聽聽聽聽BOOL聽bSwapped聽 = 聽::GetSystemMetrics(SM_SWAPBUTTON);
聽聽聽聽::SwapMouseButton(
!
bSwapped);
聽聽聽聽
聽聽聽聽
return 0
;
}
鍙傝冧簡榪欑瘒blog錛?a >鐢–#瀹炵幇榧犳爣宸﹀彸閿嚜鍔ㄥ垏鎹?/a>

緙栬瘧鍚庣殑紼嬪簭涓嬭澆

flyingxu 2006-05-11 22:33 鍙戣〃璇勮
]]>
瀵筂FC8.1鐨勭櫧鏃ユⅵhttp://m.shnenglu.com/flyingxu/archive/2006/04/09/5208.htmlflyingxuflyingxuSun, 09 Apr 2006 13:50:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/04/09/5208.htmlhttp://m.shnenglu.com/flyingxu/comments/5208.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/04/09/5208.html#Feedback2http://m.shnenglu.com/flyingxu/comments/commentRss/5208.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/5208.html閭d箞mfc8.1涓紝鑳戒笉鑳藉浜涜繖鏍風殑緇撴瀯鍚э紵鎶婂綋鍓嶆瘮杈冩祦琛岀殑璁捐妯″紡錛岄兘鍋氭垚鐜版垚鐨勭被錛屾斁鍦╩fc涓?br />
鍛靛懙錛岄偅涓椂鍊欙紝鎴戜及璁℃病鏈変漢鍐嶈mfc璁捐鐨勫緢鐑備簡鍚э紵

涓嶈繃寰堝鎬?寮婧愮ぞ鍖洪偅涔堝浜哄湪鐢╦ava c#璁ㄨ璁捐妯″紡,MFC棰嗗煙鐨勫嵈寰堝皯,鐪熸槸濂囨?img src ="http://m.shnenglu.com/flyingxu/aggbug/5208.html" width = "1" height = "1" />

flyingxu 2006-04-09 21:50 鍙戣〃璇勮
]]>
Z - Order鐨勫垵濮嬮『搴?錛?鑽夌ǹhttp://m.shnenglu.com/flyingxu/archive/2006/04/05/5049.htmlflyingxuflyingxuWed, 05 Apr 2006 14:13:00 GMThttp://m.shnenglu.com/flyingxu/archive/2006/04/05/5049.htmlhttp://m.shnenglu.com/flyingxu/comments/5049.htmlhttp://m.shnenglu.com/flyingxu/archive/2006/04/05/5049.html#Feedback0http://m.shnenglu.com/flyingxu/comments/commentRss/5049.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/5049.html
z錛峯rder鐨勫垵濮嬮『搴忓氨鏄獥鍙e垱寤虹殑鍏堝悗欏哄簭

瀵逛簬瀛愮獥鍙o紝z-order浜巘ab 欏哄簭鐨勫叧緋?img src ="http://m.shnenglu.com/flyingxu/aggbug/5049.html" width = "1" height = "1" />

flyingxu 2006-04-05 22:13 鍙戣〃璇勮
]]>
CString鐨勫彟涓涓棶棰?鍏充簬GetBuffer/ReleaseBuffer鐨勫嚑涓敊璇緥瀛?/title><link>http://m.shnenglu.com/flyingxu/archive/2006/03/21/4430.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Tue, 21 Mar 2006 09:51:00 GMT</pubDate><guid>http://m.shnenglu.com/flyingxu/archive/2006/03/21/4430.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/4430.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/03/21/4430.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/4430.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/flyingxu/services/trackbacks/4430.html</trackback:ping><description><![CDATA[鍏充簬GetBuffer/ReleaseBuffer,緗戜笂姣旇緝嫻佽鐨勪竴縐嶈娉曟槸:濡傛灉浣犺鐩存帴淇敼CString鐨勫唴閮ㄦ暟鎹?灝辮璋冪敤GetBuffer/ReleaseBuffer.鎴戜篃鍚屾剰榪欐牱鐨勮〃榪?<br /><br />涓嬮潰鏄嚑涓緥瀛?涓昏鏄敊璇殑渚嬪瓙,鏉ュ姞娣辯悊瑙?<br />1<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"><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><font face="Courier New"><span style="COLOR: #000000">CString聽strTest聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">123</span><span style="COLOR: #000000">"</span></font><font face="Courier New"><span style="COLOR: #000000">;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽p聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽strTest.GetBuffer(</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">);<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽i聽</span><span style="COLOR: #000000">=</span></font><span style="COLOR: #000000"><font face="Courier New">聽atoi(p);<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />strTest.ReleaseBuffer();</font></span></div>榪欑鐢ㄦ硶褰撶劧娌℃湁閿?浣嗘槸鎴戣涓鴻繖閲岀殑GetBuffer/ReleaseBuffer鏄病鏈夊繀瑕佺殑,涓轟粈涔堝憿?鍥犱負<br /><font face="Courier New">int __cdecl atoi(const char *)</font> 鐨勫弬鏁版槸const char*,CString鐨勫唴閮ㄦ暟鎹偗瀹氫笉浼氳淇敼鐨?<br />鎵浠ヤ笂闈㈢殑浠g爜鍙互鐩存帴鍐欐垚<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"><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><font face="Courier New"><span style="COLOR: #000000">CString聽strTest聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">123</span><span style="COLOR: #000000">"</span></font><font face="Courier New"><span style="COLOR: #000000">;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽i聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽atoi((LPCTSTR)strTest);</span></font></div>欏轟究璇翠竴涓婫etBuffer鐨勫弬鏁伴棶棰?緗戜笂鐨勪緥瀛愪腑,寰堝閮芥槸GetBuffer(5) GetBuffer(10)榪欐牱鐨勫父鏁?瀹為檯涓殑紼嬪簭涓嶅彲鑳芥槸榪欎箞瀹規槗浜嬪厛鐭ラ亾鐨?鎵浠ヤ篃灝辨湁浜唖trTest.GetBuffer(strTest.GetLength() )鐨勫啓娉?鍏跺疄,GetBuffer(0)灝卞彲浠ヤ簡.鍙互鐢盙etBuffer鐨勬簮鐮佸緱鍒伴獙璇?<br /><br />2<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"><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">聽聽聽<font face="Courier New">聽CString聽strTest聽</font></span><font face="Courier New"><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">123聽45</span><span style="COLOR: #000000">"</span></font><font face="Courier New"><span style="COLOR: #000000">;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">some聽other聽code</span></font><span style="COLOR: #008000"><br /><font face="Courier New"><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></font></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽CString聽strTest2聽</span><span style="COLOR: #000000">=</span></font><font face="Courier New"><span style="COLOR: #000000">聽strTest;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">聽seps[]聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">"</span></font><font face="Courier New"><span style="COLOR: #000000">;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽pToken聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽</span><span style="COLOR: #000000">0</span></font><font face="Courier New"><span style="COLOR: #000000">;<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">char*聽pStr聽=聽strTest2.GetBuffer(0);</span></font><span style="COLOR: #008000"><br /><font face="Courier New"><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></font></span><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽pToken聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽strtok((</span><span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span></font><font face="Courier New"><span style="COLOR: #000000">)(LPCTSTR)strTest2,聽seps);<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><font face="Courier New"><span style="COLOR: #000000">聽聽聽聽//pToken聽</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽strtok(pStr</span></font><font face="Courier New"><span style="COLOR: #000000">,聽seps);</span></font><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽</span><span style="COLOR: #0000ff">while</span></font><font face="Courier New"><span style="COLOR: #000000">(pToken)<br /><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽pToken聽</span><span style="COLOR: #000000">=</span></font><span style="COLOR: #000000"><font face="Courier New">聽strtok(NULL,聽seps);<br /></font><img src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽聽聽聽聽聽聽聽<font face="Courier New">聽//strTest2.ReleaseBuffer(0);</font></span></div>榪愯涓婇潰鐨勪唬鐮?鍙互鐪嬪埌strTest鐨勫間篃鍙樹簡,鍛靛懙,榪欏氨鏄▼搴忎腑涓浜涘叧涓嶤String鐨勫鎬棶棰樼殑璧鋒簮.濡傛灉鐢ㄦ敞閲婁腑鐨凣etBuffer/ReleaseBuffer鏂規硶,灝變竴鐐歸棶棰樹篃娌℃湁浜?<br />鍚屾牱,瀵逛簬ReleaseBuffer鐨勫弬鏁?緙虹渷鐨勬槸-1,浣嗘槸鎴戜笉寤鴻.鍥犱負-1琛ㄧず浣跨敤褰撳墠鐨?0緇撴潫絎︿綅緗潵紜畾鏂扮殑闀垮害.鑰屼笂闈㈢殑渚嬪瓙涓?strtok鏄細閲嶆柊璁劇疆00緇撴潫絎︾殑,鎵浠?瀹夊叏鐨勫仛娉?灝辨槸鎶婅繖涓狢String鐨勯暱搴﹁涓?,ReleaseBuffer(0),鍙嶆瀹冪殑鍐呭宸茬粡鍙樹簡,涔熸病鏈変漢瑕佺敤浜?<br />璇存槑涓涓?GetBuffer/ReleaseBuffer鏂規硶鍙兘淇濊瘉strTest涓嶅彉,strTest2榪樻槸浼氬彉鐨?鎵浠?瀵逛簬涓涓垚鍛樺彉閲?姣斿m_strTest2璋冪敤ReleaseBuffer瑕佸涓涓績鐪?灞閮ㄥ彉閲忓氨涓嶇敤鎯寵繖涔堝浜?<br />閭d箞鎬庝箞浠庢渶寮濮嬪氨鎰忚瘑鍒扮▼搴忓啓閿欎簡鍛?涓婇潰浠g爜涓?font face="Courier New">(<span style="COLOR: #0000ff">char</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">)(LPCTSTR)鏄緢鍗遍櫓鐨?鎶奵onst鍘繪帀浜?鍚﹀垯strtok鏄紪璇戜笉榪囩殑,涔熶粠涓涓晶闈㈣鏄庝簡const鐨勯噸瑕佹?</span></font><br /><img src ="http://m.shnenglu.com/flyingxu/aggbug/4430.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-03-21 17:51 <a href="http://m.shnenglu.com/flyingxu/archive/2006/03/21/4430.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏充簬CString鐨勪袱涓棶棰?/title><link>http://m.shnenglu.com/flyingxu/archive/2006/03/02/3631.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Thu, 02 Mar 2006 01:29:00 GMT</pubDate><guid>http://m.shnenglu.com/flyingxu/archive/2006/03/02/3631.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/3631.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/03/02/3631.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/3631.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/flyingxu/services/trackbacks/3631.html</trackback:ping><description><![CDATA[<P><STRONG>鍏充簬CString鐨勪袱涓棶棰?BR></STRONG><FONT size=2>璇?/FONT><A class=postTitle2 id=viewpost1_TitleUrl ><FONT size=2>CString,string,char*鐨勭患鍚堟瘮杈?涓)</FONT></A> <BR><BR>1 CString鐨勫熀綾?BR>鍦ㄣ婃瘮杈冦嬩竴鏂囦腑錛屽啓鍒幫細<BR>鈥淐String錛坱ypedef CStringT<TCHAR, StrTraitMFC<TCHAR>> CString錛変負Visual C++涓渶甯哥敤鐨勫瓧絎︿覆綾伙紝緇ф壙鑷狢SimpleStringT綾伙紝涓昏搴旂敤鍦∕FC鍜孉TL緙栫▼涓紝涓昏鏁版嵁綾誨瀷鏈塩har(搴旂敤浜嶢NSI)錛寃char_t(unicode)錛孴CHAR(ANSI涓巙nicode鍧囧彲)錛涒?BR>鎴戠涓鎰熻灝辨槸鏂囩珷鍐欓敊浜嗭紝鍥犱負鎴戠湅榪嘋String鐨勬簮鐮佺殑鍟婏細<BR></P> <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"><IMG src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff"><STRONG>struct</STRONG></SPAN><STRONG><SPAN style="COLOR: #000000"> CStringData<BR><IMG id=Codehighlighter1_19_292_Open_Image onclick="this.style.display='none'; Codehighlighter1_19_292_Open_Text.style.display='none'; Codehighlighter1_19_292_Closed_Image.style.display='inline'; Codehighlighter1_19_292_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_19_292_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_19_292_Closed_Text.style.display='none'; Codehighlighter1_19_292_Open_Image.style.display='inline'; Codehighlighter1_19_292_Open_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_19_292_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.shnenglu.com/images/dot.gif"></SPAN></STRONG><SPAN id=Codehighlighter1_19_292_Open_Text><STRONG><SPAN style="COLOR: #000000">{<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">long</SPAN><SPAN style="COLOR: #000000"> nRefs;             </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> reference count</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> nDataLength;        </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> length of data (including terminator)</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> nAllocLength;       </SPAN><SPAN style="COLOR: #008000">//</SPAN></STRONG><STRONG><SPAN style="COLOR: #008000"> length of allocation<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> TCHAR data[nAllocLength]</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><SPAN style="COLOR: #000000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    TCHAR</STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> data()           </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> TCHAR* to managed data</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG id=Codehighlighter1_263_290_Open_Image onclick="this.style.display='none'; Codehighlighter1_263_290_Open_Text.style.display='none'; Codehighlighter1_263_290_Closed_Image.style.display='inline'; Codehighlighter1_263_290_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_263_290_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_263_290_Closed_Text.style.display='none'; Codehighlighter1_263_290_Open_Image.style.display='inline'; Codehighlighter1_263_290_Open_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">        </SPAN><SPAN id=Codehighlighter1_263_290_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_263_290_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> (TCHAR</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">)(</SPAN><SPAN style="COLOR: #0000ff">this</SPAN><SPAN style="COLOR: #000000">+</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">); }</SPAN></SPAN></STRONG><SPAN style="COLOR: #000000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</STRONG></SPAN></SPAN><STRONG><SPAN style="COLOR: #000000">;<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000"> CString<BR><IMG id=Codehighlighter1_310_934_Open_Image onclick="this.style.display='none'; Codehighlighter1_310_934_Open_Text.style.display='none'; Codehighlighter1_310_934_Closed_Image.style.display='inline'; Codehighlighter1_310_934_Closed_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_310_934_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_310_934_Closed_Text.style.display='none'; Codehighlighter1_310_934_Open_Image.style.display='inline'; Codehighlighter1_310_934_Open_Text.style.display='inline';" src="http://m.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_310_934_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://m.shnenglu.com/images/dot.gif"></SPAN></STRONG><SPAN id=Codehighlighter1_310_934_Open_Text><STRONG><SPAN style="COLOR: #000000">{<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000">:<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN></STRONG><STRONG><SPAN style="COLOR: #008000"> Constructors<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> constructs empty CString</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString();<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> copy constructor</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> CString</SPAN><SPAN style="COLOR: #000000">&</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000"> stringSrc);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> from a single character</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(TCHAR ch, </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> nRepeat </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000">);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> from an ANSI string (converts to TCHAR)</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(LPCSTR lpsz);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> from a UNICODE string (converts to TCHAR)</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(LPCWSTR lpsz);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> subset of characters from an ANSI string (converts to TCHAR)</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(LPCSTR lpch, </SPAN><SPAN style="COLOR: #0000ff">int</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000"> nLength);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> subset of characters from a UNICODE string (converts to TCHAR)</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(LPCWSTR lpch, </SPAN><SPAN style="COLOR: #0000ff">int</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000"> nLength);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> from unsigned characters</SPAN></STRONG><SPAN style="COLOR: #008000"><BR><STRONG><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></STRONG></SPAN><STRONG><SPAN style="COLOR: #000000">    CString(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> unsigned </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">*</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000"> psz);<BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://m.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Attributes & Operations</SPAN></STRONG></DIV> <P></SPAN><STRONG>浣嗘槸鐪嬫枃绔犵殑鏍峰瓙錛屼篃涓嶅儚鏄矖鍒舵互閫犵殑錛屽績閲屽緢鏄枒鎯戙?BR>鍚庢潵鍐嶆墦寮VC7鐨勬簮鐮佺湅錛屾灉鐒訛細<BR></STRONG></P> <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"><STRONG><SPAN style="COLOR: #000000">typedef ATL::CStringT</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> TCHAR, StrTraitMFC</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> TCHAR </SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">></SPAN></STRONG><SPAN style="COLOR: #000000"><STRONG> CString;<BR></STRONG></SPAN></DIV> <P><STRONG>鐪嬫潵寰蔣鍦ㄤ笉鐭ヤ笉瑙変腑鍋氫簡榪欎箞澶х殑鍙樺寲銆?BR><BR>2 <BR>鈥渟tring鏄柟渚跨殑錛屽彲浠ヤ粠鍑犱箮鎵鏈夌殑瀛楃涓叉瀯閫犺屾潵錛屽寘鎷珻String鍜宑har*錛?nbsp;<BR> CString嬈′箣錛屽彲浠ヤ粠鍩烘湰鐨勪竴浜涘瓧絎︿覆鍙橀噺鏋勯犺屾潵錛屽寘鎷琧har*絳夛紱 鈥?BR>鐨勭‘錛屽涓嬬殑浠g爜鏄彲浠ョ紪璇戠殑錛?BR></STRONG></P> <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"><STRONG><SPAN style="COLOR: #000000">CString strTest </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">test</SPAN><SPAN style="COLOR: #000000">"</SPAN></STRONG><STRONG><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000"> sTest(strTest);</SPAN></STRONG></DIV> <P><STRONG>浣嗘槸榪欐槸琛ㄦ槑string姣擟String鏂逛究鍚楋紵<BR>瀹為檯涓婏紝鍦╯tring sTest(strTest);涓湁涓涓嚱鏁拌璋冪敤錛屽氨鏄細<BR></STRONG></P> <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"><STRONG><SPAN style="COLOR: #000000">_AFX_INLINE CString::</SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000"> LPCTSTR() </SPAN><SPAN style="COLOR: #0000ff">const</SPAN></STRONG><SPAN style="COLOR: #000000"><BR><STRONG>    { </STRONG></SPAN><STRONG><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> m_pchData; }</SPAN></STRONG></DIV> <P><STRONG>鐒跺悗鎵嶆槸string鏋勯犵敓鎴愶紝榪欒兘璇存槸string姣擟String鏂逛究鍚楋紵搴旇璇存槸CString姣攕tring鏂逛究鎵嶅ソ銆?BR>铏界劧鍙互鐢?BR></STRONG></P> <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"><STRONG>CString strTest(sTest.c_str() );</STRONG></SPAN></DIV> <P><STRONG>鏉ュ垵濮嬪寲CString錛屼絾鏄疌String娌℃湁鍙傛暟涓簊tring鐨勬瀯閫犲嚱鏁幫紝涔熸槸涓涓皬灝忕殑閬楁喚錛屾瘯绔焥tring鏄痗++鏍囧噯搴撶殑涓閮ㄥ垎浜嗐?/STRONG></P><img src ="http://m.shnenglu.com/flyingxu/aggbug/3631.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-03-02 09:29 <a href="http://m.shnenglu.com/flyingxu/archive/2006/03/02/3631.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VC wizard鍑洪敊: Parsing error : Expected "*/" 鐨勫師鍥?/title><link>http://m.shnenglu.com/flyingxu/archive/2006/02/17/3306.html</link><dc:creator>flyingxu</dc:creator><author>flyingxu</author><pubDate>Fri, 17 Feb 2006 05:16:00 GMT</pubDate><guid>http://m.shnenglu.com/flyingxu/archive/2006/02/17/3306.html</guid><wfw:comment>http://m.shnenglu.com/flyingxu/comments/3306.html</wfw:comment><comments>http://m.shnenglu.com/flyingxu/archive/2006/02/17/3306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/flyingxu/comments/commentRss/3306.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/flyingxu/services/trackbacks/3306.html</trackback:ping><description><![CDATA[褰撴垜鍦ㄨ繍琛寃izard,閫夊埌鏌愪竴涓被鏃?閬囧埌浜嗚繖涓敊璇彁紺?<BR>Parsing error : Expected "*/"<BR>鍑洪敊鐨勪唬鐮佸涓?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">BEGIN_EVENTSINK_MAP(CMonitorView, CFormView)<BR>    //{{AFX_EVENTSINK_MAP(CMonitorView)<BR>    ON_EVENT(CMonitorView, IDC_REGVALUE,       </SPAN><SPAN style="COLOR: #000000">72</SPAN><SPAN style="COLOR: #000000">    </SPAN><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000"> Leave Cell </SPAN><SPAN style="COLOR: #008000">*/</SPAN><SPAN style="COLOR: #000000">,     OnLeaveCellRV, VTS_NONE)    <BR>    //}}AFX_EVENTSINK_MAP<BR>END_EVENTSINK_MAP()</SPAN></DIV>浣嗘槸鎴戠湅鏉ョ湅鍘繪病鏈夐棶棰?<BR><BR>鍚庢潵鎵懼埌鏈鍒濈殑浠g爜涓瀵規瘮,鍘熸潵/* Leave<FONT style="BACKGROUND-COLOR: #ff1493" color=#000000> </FONT>Cell */涓棿鏈変釜絀烘牸, 鏄殑wizard瑙f瀽鍑洪敊,鍘繪帀絀烘牸灝卞ソ浜?鍝?BR><img src ="http://m.shnenglu.com/flyingxu/aggbug/3306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/flyingxu/" target="_blank">flyingxu</a> 2006-02-17 13:16 <a href="http://m.shnenglu.com/flyingxu/archive/2006/02/17/3306.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鐢–String浣滀負Key浣跨敤CMaphttp://m.shnenglu.com/flyingxu/archive/2005/12/27/4274.htmlflyingxuflyingxuMon, 26 Dec 2005 23:17:00 GMThttp://m.shnenglu.com/flyingxu/archive/2005/12/27/4274.htmlhttp://m.shnenglu.com/flyingxu/comments/4274.htmlhttp://m.shnenglu.com/flyingxu/archive/2005/12/27/4274.html#Feedback5http://m.shnenglu.com/flyingxu/comments/commentRss/4274.htmlhttp://m.shnenglu.com/flyingxu/services/trackbacks/4274.html
鏂囩珷鏉ユ簮:http://blog.csdn.net/flyingxu/archive/2005/12/26/562852.aspx

閬囧埌濂藉嚑涓漢璇碈Map鍦ㄧ敤CString鍋歬ey綾誨瀷鏃舵湁闂錛岃鐢╥nt鍜孌WORD灝卞彲浠ワ紝鐢–String灝變笉琛屻傚洜姝ゅ緢澶氫漢鎺ㄨ崘浣跨敤MFC涓殑CMapStringToPtr涔嬬被銆?/p>

鐪嬩笅闈㈢殑浠g爜錛?br />//.h
聽聽聽聽CMap<CString, LPCTSTR, int, int> typeMap;
//.cpp
聽聽聽聽typeMap.SetAt(_T("ONE"),1);
聽聽聽聽typeMap.SetAt(_T("TWO"),2);

聽聽聽聽int nValue = 0;
聽聽聽聽BOOL ret = typeMap.Lookup(_T("ONE"), nValue);
聽聽聽聽ret = typeMap.Lookup(_T("THREE"), nValue);
聽聽聽聽ret = typeMap.Lookup(_T("TWO"), nValue);
鎴戠殑浠g爜榪愯鐨勫緢濂斤紝鎴戣寰楀叧閿槸ARG_KEY瑕侀塋PCTSTR



flyingxu 2005-12-27 07:17 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            久久综合九色综合欧美就去吻| 亚洲国产成人av在线| 一区二区三区欧美| 久久精品一区四区| 亚洲婷婷免费| 欧美日韩综合在线免费观看| 亚洲人成网站777色婷婷| 久久久久一区二区三区| 中文网丁香综合网| 欧美日韩在线播放三区| 亚洲美女av黄| 亚洲韩国日本中文字幕| 蜜乳av另类精品一区二区| 激情国产一区二区| 欧美在线免费视屏| 亚洲一区二区三区国产| 国产精品免费电影| 亚洲欧美久久久久一区二区三区| 一区二区91| 国产精品无码专区在线观看| 欧美一区2区视频在线观看| 亚洲无限乱码一二三四麻| 国产精品日韩久久久久| 欧美一区1区三区3区公司| 欧美在线高清| 亚洲第一精品久久忘忧草社区| 美女福利精品视频| 欧美成人午夜影院| 制服丝袜亚洲播放| 亚洲主播在线观看| 激情国产一区二区| 亚洲肉体裸体xxxx137| 欧美色图麻豆| 久久久久久电影| 美女国内精品自产拍在线播放| 日韩一级不卡| 亚洲欧美怡红院| 亚洲国产一区二区三区青草影视 | av成人激情| 99视频+国产日韩欧美| 国产女主播一区二区三区| 久久伊人亚洲| 欧美日韩视频| 久久只有精品| 久久久精品五月天| 欧美xx69| 欧美午夜精品一区| 欧美/亚洲一区| 国产精品成人在线| 久久影视三级福利片| 欧美激情按摩| 久久精品视频免费| 欧美日韩爆操| 久久一综合视频| 国产精品豆花视频| 亚洲第一网站| 国产网站欧美日韩免费精品在线观看 | 亚洲欧美综合v| 一区二区三区视频免费在线观看| 西瓜成人精品人成网站| 日韩亚洲精品视频| 久久精品国产一区二区三区免费看| 亚洲另类黄色| 亚洲中午字幕| 久久久噜噜噜久久中文字免| 国产精品99久久久久久久vr| 久久久www成人免费精品| 亚洲影院一区| 欧美高清在线视频| 免费视频一区二区三区在线观看| 欧美色网在线| 亚洲另类一区二区| 亚洲精品免费在线播放| 久久久美女艺术照精彩视频福利播放 | 亚洲永久视频| 欧美高清视频在线 | 久久精品日韩| 久久本道综合色狠狠五月| 欧美午夜精品久久久久免费视| 亚洲国内欧美| 日韩视频在线观看| 美女国内精品自产拍在线播放| 久久先锋资源| 国产日韩欧美麻豆| 亚洲综合日韩在线| 性欧美18~19sex高清播放| 欧美日韩调教| 日韩一级精品视频在线观看| 一区二区成人精品| 欧美日韩在线观看视频| 日韩视频不卡中文| 亚洲在线成人| 国产精品视频一区二区高潮| 亚洲伊人久久综合| 欧美在线观看天堂一区二区三区 | 久久久精品国产免大香伊| 国产欧美日韩综合精品二区| 亚洲一区欧美| 久久久国产一区二区| 激情欧美国产欧美| 久久久久久久性| 牛夜精品久久久久久久99黑人| 国产亚洲一二三区| 欧美一区二区精品| 欧美日韩精品免费观看视频| 亚洲精品乱码久久久久久日本蜜臀 | 亚洲欧洲精品天堂一级| 亚洲免费福利视频| 精品成人在线视频| 亚洲视频999| 99国产精品国产精品久久| 久久国产精品72免费观看| 亚洲素人在线| 欧美国产日韩一区| 蜜臀久久99精品久久久画质超高清 | 欧美成人国产| 国产欧美一级| 亚洲一区二区三区四区五区黄| 亚洲国产老妈| 久久男女视频| 久久免费国产精品| 国产丝袜美腿一区二区三区| 亚洲视频久久| 亚洲一区二区欧美日韩| 欧美久久久久免费| 亚洲福利视频专区| 亚洲国产成人久久综合一区| 欧美中文字幕| 久久久久久久91| 国产主播精品在线| 性欧美超级视频| 性欧美videos另类喷潮| 国产精品sss| 亚洲一区在线直播| 久久精品国产96久久久香蕉| 国产精品一区二区三区久久久| 在线视频欧美日韩精品| 亚洲一区二区网站| 国产精品久久久久9999| 亚洲一级电影| 久久久久久久久蜜桃| 激情av一区| 快播亚洲色图| 亚洲精品国产视频| av72成人在线| 国产精品欧美精品| 欧美一区二区私人影院日本| 久久天堂国产精品| 亚洲日本无吗高清不卡| 欧美日韩免费网站| 亚洲欧美日韩精品久久久久| 久久久久久黄| 99国产一区| 国产日韩欧美视频| 久久婷婷丁香| 日韩亚洲综合在线| 久久成人国产精品| 亚洲国产欧美不卡在线观看| 欧美日韩成人精品| 午夜精品久久久久久| 欧美成人午夜视频| 久久久国产91| 亚洲国内自拍| 欧美视频中文字幕在线| 欧美一区二区久久久| 亚洲国产老妈| 欧美一区二区三区婷婷月色| 在线日本欧美| 国产精品地址| 老鸭窝毛片一区二区三区| 日韩午夜av| 另类尿喷潮videofree| 一区二区日韩欧美| 国产在线精品自拍| 欧美成人有码| 欧美在线播放一区二区| 亚洲欧洲日产国产网站| 久久久久久午夜| 亚洲一区二区三区在线播放| 亚洲国产成人91精品| 国产精品免费网站| 免费久久99精品国产自在现线| 亚洲午夜日本在线观看| 亚洲高清免费视频| 欧美在线播放一区| 夜夜嗨av一区二区三区网页| 国产一区二区三区av电影| 欧美日韩成人综合在线一区二区| 久久激情久久| 性久久久久久久久久久久| 一区二区三区产品免费精品久久75| 乱码第一页成人| 久久久久久高潮国产精品视| 性欧美xxxx大乳国产app| 一个色综合导航| 99精品99久久久久久宅男| 亚洲成色999久久网站| 国产一区二区三区在线观看免费| 欧美日韩中文精品| 欧美国产大片|