锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产欧美午夜,欧美一区二区三区免费看,欧美三区在线观看http://m.shnenglu.com/twzheng/category/3938.html銆庣珯鍦ㄩ鍙f氮灝栫揣鎻′綇榧犳爣鏃嬭漿錛併? 浜哄湪鍙板寳蹇冨湪姹?/description>zh-cnMon, 15 Mar 2010 04:03:27 GMTMon, 15 Mar 2010 04:03:27 GMT60姹倃indows xp 綣佷綋鐗?/title><link>http://m.shnenglu.com/twzheng/articles/109710.html</link><dc:creator>璋枃鏀?/dc:creator><author>璋枃鏀?/author><pubDate>Sun, 14 Mar 2010 16:05:00 GMT</pubDate><guid>http://m.shnenglu.com/twzheng/articles/109710.html</guid><wfw:comment>http://m.shnenglu.com/twzheng/comments/109710.html</wfw:comment><comments>http://m.shnenglu.com/twzheng/articles/109710.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/twzheng/comments/commentRss/109710.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/twzheng/services/trackbacks/109710.html</trackback:ping><description><![CDATA[姹倃indows xp 綣佷綋鐗堬紝鏈濂芥槸鍙版咕鐗堢殑錛岃鑳戒竴姝ユ鐨勬墜鍔ㄥ畨瑁?鎯寵鍙岀郴緇?<br><br>鎵句簡濂藉嚑澶╀簡錛屽緢澶氳祫婧愰兘涓嬩笉鍔?br><br>浠婂ぉ濂戒笉瀹規槗涓嬩簡涓涓紝浣嗘槸棣欐腐鐗堢殑錛屼笖瀹夎鍒伴夋嫨鐩樼鏃訛紝閿洏鎵鏈夐敭閮戒笉鑳戒嬌鐢紝鎵浠ヨ繕鏄棤娉曞畨瑁?br><br>璋㈣阿鍚勪綅澶у摜澶у甯府蹇欙紝灝忓紵鎰熸縺涓嶅敖錛?img src ="http://m.shnenglu.com/twzheng/aggbug/109710.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/twzheng/" target="_blank">璋枃鏀?/a> 2010-03-15 00:05 <a href="http://m.shnenglu.com/twzheng/articles/109710.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹屾垚绔彛涓殑鍗曞彞鏌勬暟鎹粨鏋勪笌鍗旾O鏁版嵁緇撴瀯鐨勭悊瑙d笌璁捐http://m.shnenglu.com/twzheng/articles/25359.html璋枃鏀?/dc:creator>璋枃鏀?/author>Sat, 02 Jun 2007 15:19:00 GMThttp://m.shnenglu.com/twzheng/articles/25359.htmlhttp://m.shnenglu.com/twzheng/comments/25359.htmlhttp://m.shnenglu.com/twzheng/articles/25359.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/25359.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/25359.html瀹屾垚绔彛涓殑鍗曞彞鏌勬暟鎹粨鏋勪笌鍗旾O鏁版嵁緇撴瀯鐨勭悊瑙d笌璁捐

鏈枃浣滆咃細sodme
鏈枃鍑哄錛?font style="COLOR: #000000" color=#0000ff>http://blog.csdn.net/sodme
澹版槑錛氭湰鏂囧彲浠ヤ笉緇忎綔鑰呭悓鎰忎換鎰忚漿杞姐佸鍒躲佷紶鎾紝浣嗕換浣曞鏈枃鐨勫紩鐢ㄥ潎欏諱繚鐣欐湰鏂囩殑浣滆呫佸嚭澶勫強鏈澹版槑淇℃伅錛佽阿璋紒

銆銆瀹屾垚绔彛妯″瀷錛岄拡瀵逛簬WIN騫沖彴鐨勫叾瀹冨紓姝ョ綉緇滄ā鍨嬭岃█錛屾渶澶х殑濂藉錛岄櫎浜嗘ц兘鏂歸潰鐨勫崜瓚婂錛岃繕鍦ㄤ簬瀹屾垚绔彛鍦ㄤ紶閫掔綉緇滀簨浠剁殑閫氱煡鏃訛紝鍙互涓騫朵紶閫掍笌姝や簨浠剁浉鍏崇殑搴旂敤灞傛暟鎹傝繖涓簲鐢ㄥ眰鏁版嵁錛屼綋鐜板湪涓や釜鏂歸潰錛氫竴鏄崟鍙ユ焺鏁版嵁錛屼簩鏄崟IO鏁版嵁銆?br>
銆銆GetQueuedCompletionStatus鍑芥暟鐨勫師鍨嬪涓嬶細
銆銆WINBASEAPI
銆銆BOOL
銆銆WINAPI
銆銆GetQueuedCompletionStatus(
    銆銆IN  HANDLE CompletionPort,
   銆銆 OUT LPDWORD lpNumberOfBytesTransferred,
    銆銆OUT PULONG_PTR lpCompletionKey,
    銆銆OUT LPOVERLAPPED *lpOverlapped,
    銆銆IN  DWORD dwMilliseconds
    銆);
銆銆鍏朵腑錛屾垜浠妸絎笁涓弬鏁發pCompletionKey縐頒負瀹屾垚閿紝鐢卞畠浼犻掔殑鏁版嵁縐頒負鍗曞彞鏌勬暟鎹傛垜浠妸絎洓涓弬鏁發pOverlapped縐頒負閲嶅彔緇撴瀯浣擄紝鐢卞畠浼犻掔殑鏁版嵁縐頒負鍗旾O鏁版嵁銆?br>
銆銆浠ュ瓧闈㈢殑鎰忔濇潵鐞嗚В錛宭pCompletionKey鍐呭寘瀹圭殑涓滆タ搴旇鏄笌鍚勪釜socket涓涓瀵瑰簲鐨勶紝鑰宭pOverlapped鏄笌姣忎竴嬈$殑wsarecv鎴杦sasend鎿嶄綔涓涓瀵瑰簲鐨勩?br>
銆銆鍦ㄧ綉緇滄ā鍨嬬殑甯歌璁捐涓紝褰撲竴涓鎴風榪炴帴鍒版湇鍔″櫒鍚庯紝鏈嶅姟鍣ㄤ細閫氳繃accept鎴朅cceptEx鍒涘緩涓涓猻ocket錛岃屽簲鐢ㄥ眰涓轟簡淇濆瓨涓庢socket鐩稿叧鐨勫叾瀹冧俊鎭紙姣斿錛氳socket鎵瀵瑰簲鐨剆ockaddr_in緇撴瀯浣撴暟鎹紝璇ョ粨鏋勪綋鍐呭惈瀹㈡埛绔疘P絳変俊鎭紝浠ュ強涓轟究浜庡鎴風鐨勯昏緫鍖呮暣鐞嗚屽噯澶囩殑鏁版嵁鏁寸悊緙撳啿鍖虹瓑錛夛紝寰寰闇瑕佸垱寤轟竴涓笌璇ocket涓涓瀵瑰簲鐨勫鎴風搴曞眰閫氫俊瀵硅薄錛岃繖涓璞″彲浠ヨ礋璐d繚瀛樹粎鍦ㄧ綉緇滃眰闇瑕佸鐞嗙殑鏁版嵁鎴愬憳鍜屾柟娉曪紝鐒跺悗鎴戜滑闇瑕佸皢姝ゅ鎴風搴曞眰閫氫俊瀵硅薄鏀懼叆涓涓被浼間簬list鎴杕ap鐨勫鍣ㄤ腑錛屽緟鍒伴渶瑕佷嬌鐢ㄧ殑鏃跺欙紝浣跨敤瀹瑰櫒鐨勬煡鎵劇畻娉曟牴鎹畇ocket鍊兼壘鍒板畠鎵瀵瑰簲鐨勫璞$劧鍚庤繘琛屾垜浠墍闇瑕佺殑鎿嶄綔銆?br>
銆銆璁╀漢闈炲父楂樺叴鐨勬槸錛屽畬鎴愮鍙?#8220;浣撹創鍏ュ井”錛屽畠宸茬粡甯垜浠湪姣忔鐨勫畬鎴愪簨浠墮氱煡鏃訛紝紼嶅甫鐫鎶婅socket鎵瀵瑰簲鐨勫簳灞傞氫俊瀵硅薄鐨勬寚閽堥佺粰浜嗘垜浠紝榪欎釜鎸囬拡灝辨槸lpCompletionKey銆備篃灝辨槸璇達紝褰撴垜浠粠GetQueuedCompletionStatus鍑芥暟鍙栧緱涓涓暟鎹帴鏀跺畬鎴愮殑閫氱煡錛岄渶瑕佸皢姝ゆ鏀跺埌鐨勬暟鎹斁鍒拌socket鎵瀵瑰簲鐨勯氫俊瀵硅薄鏁寸悊緙撳啿鍖哄唴瀵規暟鎹繘琛屾暣鐞嗘椂錛屾垜浠凡緇忎笉闇瑕佸幓鎵цlist鎴杕ap絳夌殑鏌ユ壘綆楁硶錛岃屾槸鍙互鐩存帴瀹氫綅榪欎釜瀵硅薄浜嗭紝褰撳鎴風榪炴帴閲忓緢澶ф椂錛岄綣佹煡琛ㄨ繕鏄緢褰卞搷鏁堢巼鐨勩傚搰鍝︼紝澶竻浜嗭紝涓嶆槸鍚楋紵鍛靛懙銆?br>
銆銆鍩轟簬浠ヤ笂鐨勮璇嗭紝鎴戜滑鐨刲pCompletionKey瀵硅薄鍙互璁捐濡備笅錛?br>銆銆typedef struct PER_HANDLE_DATA
銆銆{
銆銆銆銆SOCKET socket;銆銆銆銆銆銆銆銆銆銆   //鏈粨鏋勪綋瀵瑰簲鐨剆ocket鍊?br>銆銆銆銆sockaddr_in addr;銆銆銆銆銆銆銆銆銆銆//鐢ㄤ簬瀛樻斁瀹㈡埛绔疘P絳変俊鎭?br>銆銆銆銆char DataBuf[ 2*MAX_BUFFER_SIZE ];銆銆//鏁寸悊緙撳啿鍖?鐢ㄤ簬瀛樻斁姣忔鏁寸悊鏃剁殑鏁版嵁
銆銆}

銆銆PER_HANDLE_DATA涓巗ocket鐨勭粦瀹氾紝閫氳繃CreateIOCompletionPort瀹屾垚錛屽皢璇ョ粨鏋勪綋鍦板潃浣滀負璇ュ嚱鏁扮殑絎笁涓弬鏁頒紶鍏ュ嵆鍙傝孭ER_HANDLE_DATA緇撴瀯浣撲腑addr鎴愬憳錛屾槸鍦╝ccept鎵ц鎴愬姛鍚庤繘琛岃祴鍊肩殑銆侱ataBuf鍒欏彲浠ュ湪姣忔WSARecv鎿嶄綔瀹屾垚錛岄渶瑕佹暣鐞嗙紦鍐插尯鏁版嵁鏃朵嬌鐢ㄣ?br>
銆銆涓嬮潰鎴戜滑鍐嶆潵鐪嬬湅瀹屾垚绔彛鐨勬敹銆佸彂鎿嶄綔涓墍浣跨敤鍒扮殑閲嶅彔緇撴瀯浣揙VERLAPPED銆?br>
銆銆鍏充簬閲嶅彔IO鐨勭煡璇嗭紝璇瘋嚜琛孏OOGLE鐩稿叧璧勬枡銆傜畝鍗曞湴璇達紝OVERLAPPED鏄簲鐢ㄥ眰涓庢牳蹇冨眰浜や簰鍏變韓鐨勬暟鎹崟鍏冿紝濡傛灉瑕佹墽琛屼竴涓噸鍙營O鎿嶄綔錛屽繀欏誨甫鏈塐VERLAPPED緇撴瀯銆傚湪瀹屾垚绔彛涓紝瀹冨厑璁稿簲鐢ㄥ眰瀵筄VERLAPPED緇撴瀯榪涜鎵╁睍鍜岃嚜瀹氫箟錛屽厑璁稿簲鐢ㄥ眰鏍規嵁鑷繁鐨勯渶瑕佸湪OVERLAPPED鐨勫熀紜涓婂艦鎴愭柊鐨勬墿灞昈VERLAPPED緇撴瀯銆備竴鑸湴錛屾墿灞曠殑OVERLAPPED緇撴瀯涓紝瑕佹眰鏀懼湪絎竴涓殑鏁版嵁鎴愬憳鏄師OVERLAPPED緇撴瀯銆傛垜浠彲浠ュ艦濡備互涓嬫柟寮忓畾涔夎嚜宸辯殑鎵╁睍OVERLAPPED緇撴瀯錛?br>銆銆typedef struct PER_IO_DATA
銆銆{
銆銆銆銆OVERLAPPED ovl;
銆銆銆銆WSABUF           buf;
銆銆銆銆char                    RecvDataBuf[ MAX_BUFFER_SIZE ];   //鎺ユ敹緙撳啿鍖?br>銆銆銆銆char                    SendDataBuf[ MAX_BUFFER_SIZE ];   //鍙戦佺紦鍐插尯
銆銆銆銆OpType              opType;                                                       //鎿嶄綔綾誨瀷錛氬彂閫併佹帴鏀舵垨鍏抽棴絳?br>銆銆}
銆銆
銆銆鍦ㄦ墽琛學SASend鍜學SARecv鎿嶄綔鏃訛紝搴旂敤灞備細灝嗘墿灞昈VERLAPPED緇撴瀯鐨勫湴鍧浼犵粰鏍稿績錛屾牳蹇冨畬鎴愮浉搴旂殑鎿嶄綔鍚庯紝浠嶇劧閫氳繃鍘熸湁鐨勮繖涓粨鏋勪紶閫掓搷浣滅粨鏋滐紝姣斿“鎺ユ敹”鎿嶄綔瀹屾垚鍚庯紝RecvDataBuf閲屽瓨鏀句究鏄嬈℃帴鏀朵笅鏉ョ殑鏁版嵁銆?br>
銆銆鏍規嵁鍚勮嚜搴旂敤鐨勪笉鍚岋紝涓嶅悓鐨勫畬鎴愮鍙h璁¤呭彲鑳戒細璁捐鍑轟笉鍚岀殑PER_HANDLE_DATA
鍜孭ER_IO_DATA錛屾垜榪欓噷緇欏嚭鐨勮璁′篃鍙槸閽堝鑷繁鐨勫簲鐢ㄥ満鍚堢殑錛屼笉涓瀹氬氨閫傚悎浣犮備絾鎴戞兂錛屾渶涓昏鐨勮繕鏄鎼炴槑鐧絇ER_HANDLE_DATA鍜孭ER_IO_DATA涓ょ緇撴瀯浣撶殑鍚箟銆佺敤閫旓紝浠ュ強璋冪敤嫻佺▼銆?br>

]]>
Windows Sockets 2.0:浣跨敤瀹屾垚绔彛楂樻ц兘錛屽彲鎵╁睍鎬insock鏈嶅姟紼嬪簭http://m.shnenglu.com/twzheng/articles/25140.html璋枃鏀?/dc:creator>璋枃鏀?/author>Wed, 30 May 2007 09:24:00 GMThttp://m.shnenglu.com/twzheng/articles/25140.htmlhttp://m.shnenglu.com/twzheng/comments/25140.htmlhttp://m.shnenglu.com/twzheng/articles/25140.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/25140.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/25140.html闃呰鍏ㄦ枃

]]>
綾諱技浜嶲Q娓告垙鐧句竾浜哄悓鏃跺湪綰跨殑鏈嶅姟鍣ㄦ灦鏋勫疄鐜?http://m.shnenglu.com/twzheng/articles/24801.html璋枃鏀?/dc:creator>璋枃鏀?/author>Thu, 24 May 2007 18:58:00 GMThttp://m.shnenglu.com/twzheng/articles/24801.htmlhttp://m.shnenglu.com/twzheng/comments/24801.htmlhttp://m.shnenglu.com/twzheng/articles/24801.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/24801.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/24801.html綾諱技浜嶲Q娓告垙鐧句竾浜哄悓鏃跺湪綰跨殑鏈嶅姟鍣ㄦ灦鏋勫疄鐜?/span>

鏈枃浣滆咃細sodme銆鏈枃鍑哄錛歨ttp://blog.csdn.net/sodme
鐗堟潈澹版槑錛氭湰鏂囧彲浠ヤ笉緇忎綔鑰呭悓鎰忎換鎰忚漿杞斤紝浣嗚漿杞芥椂鐑﹁淇濈暀鏂囩珷寮濮嬪墠涓よ鐨勭増鏉冦佷綔鑰呭強鍑哄淇℃伅銆?br>
銆銆QQ娓告垙浜庡墠鍑犳棩緇堜簬紿佺牬浜嗙櫨涓囦漢鍚屾椂鍦ㄧ嚎鐨勫叧鍙o紝鍚戠潃鏇翠負榪滃ぇ鐨勭洰鏍囪繄榪涳紝榪欒鍏跺畠浼楀浼犵粺鐨勬鐗屼紤闂叉父鎴忓鉤鍙伴化鐒跺け鑹詫紝鐩告瘮涔嬩笅錛岃仈浼椾技涔庡凡緇忔牴鏈笉鏄疩Q鐨勫鎵嬶紝鍥犱負QQ闄や簡榪?00涓囩殑娓告垙鍦ㄧ嚎浜烘暟澶栵紝瀹冭繕鎷ユ湁3浜垮鐨勬敞鍐岄噺錛堝綋鐒跺緢澶氭槸閲嶅娉ㄥ唽鐨勶級浠ュ強QQ鑱婂ぉ杞歡900涓囩殑鍚屾椂鍦ㄧ嚎鐜囷紝鎴戜滑宸茬粡鍙互棰勮鏈潵鐢盦Q鏋勫緩璧鋒潵鐨勫己澶ф鐗屼紤闂叉父鎴忓笣鍥姐?br>銆銆閭d箞錛屽湪鎶鏈笂錛孮Q娓告垙鍒板簳鏄浣曞疄鐜扮櫨涓囦漢鍚屾椂鍦ㄧ嚎騫朵繚鎸佹父鎴忛珮鏁堢巼鐨勫憿錛?br>銆銆浜嬪疄涓婏紝閽堝浜庝換浣曞崟涓鐨勭綉緇滄湇鍔″櫒紼嬪簭錛屽叾鍙壙鍙楃殑鍚屾椂榪炴帴鏁扮洰鏄湁鐞嗚宄板肩殑錛岄氳繃C錛嬶紜涓TSocket鐨勫畾涔夌被鍨嬶細word錛屾垜浠彲浠ュ垽瀹氳繖涓繛鎺ョ悊璁哄嘲鍊兼槸65535錛屼篃灝辨槸璇達紝浣犵殑鍗曚釜鏈嶅姟鍣ㄧ▼搴忥紝鏈澶氬彲浠ユ壙鍙?涓囧鐨勭敤鎴峰悓鏃惰繛鎺ャ備絾鏄紝鍦ㄥ疄闄呭簲鐢ㄤ腑錛岃兘杈懼埌涓涓囦漢鐨勫悓鏃惰繛鎺ュ茍鑳戒繚璇佹甯哥殑鏁版嵁浜ゆ崲宸茬粡鏄緢涓嶅鏄撲簡錛岄氬父榪欎釜鍊奸兘鍦?000鍒?000涔嬮棿錛屾嵁璇碤Q鐨勫崟鍙版湇鍔″櫒鍚屾椂榪炴帴鏁扮洰涔熷氨鏄湪榪欎釜鍊艱繖闂淬?br>銆銆濡傛灉瑕佸疄鐜?000鍒?000鐢ㄦ埛鐨勫崟鏈嶅姟鍣ㄥ悓鏃跺湪綰匡紝鏄笉闅劇殑銆傚湪windows涓嬶紝姣旇緝鎴愮啛鐨勬妧鏈槸閲囩敤IOCP錛嶏紞瀹屾垚绔彛銆備笌瀹屾垚绔彛鐩稿叧鐨勮祫鏂欏湪緗戜笂鍜孋SDN璁哄潧閲屾湁寰堝錛屾劅鍏磋叮鐨勬湅鍙嬪彲浠ヨ嚜宸辨悳绱竴涓嬨傚彧瑕佽繍鐢ㄥ緱褰擄紝涓涓畬鎴愮鍙f湇鍔″櫒鏄畬鍏ㄥ彲浠ヨ揪鍒?K鍒?K鐨勫悓鏃跺湪綰塊噺鐨勩備絾錛?K榪欐牱鐨勬暟鍊肩鐧句竾榪欐牱鐨勬暟鍊煎疄鍦ㄧ浉宸お澶т簡錛屾墍浠ワ紝鐧句竾浜虹殑鍚屾椂鍦ㄧ嚎鏄崟鍙版湇鍔″櫒鑲畾鏃犳硶瀹炵幇鐨勩?br>銆銆瑕佸疄鐜扮櫨涓囦漢鍚屾椂鍦ㄧ嚎錛岄鍏堣瀹炵幇涓涓瘮杈冨畬鍠勭殑瀹屾垚绔彛鏈嶅姟鍣ㄦā鍨嬶紝榪欎釜妯″瀷瑕佹眰鑷沖皯鍙互鎵胯澆2K鍒?K鐨勫悓鏃跺湪綰跨巼錛堝綋鐒訛紝濡傛灉浣燤ONEY澶氾紝浣犱篃鍙互鍙紑鍙戝嚭鏈澶氬厑璁?00浜哄湪綰跨殑鏈嶅姟鍣級銆傚湪鏋勫緩濂戒簡鍩烘湰鐨勫畬鎴愮鍙f湇鍔″櫒涔嬪悗錛屽氨鏄湁鍏蟲湇鍔″櫒緇勭殑鏋舵瀯璁捐浜嗐備箣鎵浠ヨ榪欐槸涓涓湇鍔″櫒緇勶紝鏄洜涓哄畠緇濅笉浠呬粎鍙槸涓鍙版湇鍔″櫒錛屼篃緇濅笉浠呬粎鏄彧鏈変竴縐嶇被鍨嬬殑鏈嶅姟鍣ㄣ?br>銆銆綆鍗曞湴璇達紝瀹炵幇鐧句竾浜哄悓鏃跺湪綰跨殑鏈嶅姟鍣ㄦā鍨嬪簲璇ユ槸錛氱櫥闄嗘湇鍔″櫒錛嬪ぇ鍘呮湇鍔″櫒錛嬫埧闂存湇鍔″櫒銆傚綋鐒訛紝涔熷彲浠ユ槸鍏跺畠鐨勬ā鍨嬶紝浣嗗叾鍩烘湰鐨勬濇兂鏄竴鏍風殑銆備笅闈紝鎴戝皢閫愪竴浠嬬粛榪欎笁綾繪湇鍔″櫒鐨勫悇鑷綔鐢ㄣ?br>銆銆鐧婚檰鏈嶅姟鍣細涓鑸儏鍐典笅錛屾垜浠細鍚戠帺瀹跺紑鏀捐嫢騫蹭釜鍏紑鐨勭櫥闄嗘湇鍔″櫒錛屽氨濡俀Q鐧婚檰鏃惰浣犻夋嫨鐨勪粠鍝釜QQ娓告垙鏈嶅姟鍣ㄧ櫥闄嗕竴鏍鳳紝QQ鐧婚檰鏃惰鐜╁閫夋嫨鐨勫叚涓湇鍔″櫒鍏ュ彛瀹為檯涓婂氨鏄櫥闄嗘湇鍔″櫒銆傜櫥闄嗘湇鍔″櫒涓昏瀹屾垚璐熻澆騫寵 鐨勪綔鐢ㄣ傝緇嗙偣璇村氨鏄紝鍦ㄧ櫥闄嗘湇鍔″櫒鐨勮儗鍚庯紝鏈塏涓ぇ鍘呮湇鍔″櫒錛岀櫥闄嗘湇鍔″櫒鍙槸鐢ㄤ簬涓哄綋鍓嶇殑瀹㈡埛绔繛鎺ラ夋嫨鍏朵笅涓姝ュ簲璇ヨ繛鎺ュ埌鍝釜澶у巺鏈嶅姟鍣紝褰撶櫥闄嗘湇鍔″櫒涓哄綋鍓嶇殑瀹㈡埛绔繛鎺ラ夋嫨浜嗕竴涓悎閫傜殑澶у巺鏈嶅姟鍣ㄥ悗錛屽鎴風寮濮嬫牴鎹櫥闄嗘湇鍔″櫒鎻愪緵鐨勪俊鎭繛鎺ュ埌鐩稿簲鐨勫ぇ鍘呬笂鍘伙紝鍚屾椂瀹㈡埛绔柇寮涓庣櫥闄嗘湇鍔″櫒鐨勮繛鎺ワ紝涓哄叾浠栫帺瀹跺鎴風榪炴帴鐧婚檰鏈嶅姟鍣ㄨ吘鍑哄鎺ュ瓧璧勬簮銆傚湪璁捐鐧婚檰鏈嶅姟鍣ㄦ椂錛岃嚦灝戝簲璇ユ湁浠ヤ笅鍔熻兘錛歂涓ぇ鍘呮湇鍔″櫒鐨勬瘡涓涓ぇ鍘呮湇鍔″櫒閮借涓庢墍鏈夌殑鐧婚檰鏈嶅姟鍣ㄤ繚鎸佽繛鎺ワ紝騫跺疄鏃跺湴鎶婃湰澶у巺鏈嶅姟鍣ㄥ綋鍓嶇殑鍚屾椂鍦ㄧ嚎浜烘暟閫氱煡緇欏悇涓櫥闄嗘湇鍔″櫒錛岃繖鍏朵腑鍖呮嫭錛氱敤鎴瘋繘鍏ユ椂鐨勫悓鏃跺湪綰夸漢鏁板鍔犱俊鎭互鍙婄敤鎴烽鍑烘椂鐨勫悓鏃跺湪綰夸漢鏁板噺灝戜俊鎭傝繖閲岀殑鍚勪釜澶у巺鏈嶅姟鍣ㄥ悓鏃跺湪綰夸漢鏁頒俊鎭氨鏄櫥闄嗘湇鍔″櫒涓哄鎴風閫夋嫨鏌愪釜澶у巺璁╁叾鐧婚檰鐨勪緷鎹備婦渚嬫潵璇達紝鐜╁A閫氳繃鐧婚檰鏈嶅姟鍣?榪炴帴鍒扮櫥闄嗘湇鍔″櫒錛岀櫥闄嗘湇鍔″櫒寮濮嬩負褰撳墠鐜╁鍦ㄤ紬澶氱殑澶у巺鏈嶅姟鍣ㄤ腑鏍規嵁鍝竴涓ぇ鍘呮湇鍔″櫒浜烘暟姣旇緝灝戞潵閫夋嫨涓涓ぇ鍘咃紝鍚屾椂鎶婅繖涓ぇ鍘呯殑榪炴帴IP鍜岀鍙e彂緇欏鎴風錛屽鎴風鏀跺埌榪欎釜IP鍜岀鍙d俊鎭悗錛屾牴鎹繖涓俊鎭繛鎺ュ埌姝ゅぇ鍘咃紝鍚屾椂錛屽鎴風鏂紑涓庣櫥闄嗘湇鍔″櫒涔嬮棿鐨勮繛鎺ワ紝榪欎究鏄敤鎴風櫥闄嗚繃紼嬩腑錛屽湪鐧婚檰鏈嶅姟鍣ㄨ繖涓鍧楃殑澶勭悊嫻佺▼銆?br>銆銆澶у巺鏈嶅姟鍣細澶у巺鏈嶅姟鍣紝鏄櫘閫氱帺瀹剁湅涓嶅埌鐨勬湇鍔″櫒錛屽畠鐨勮繛鎺P鍜岀鍙d俊鎭槸鐧婚檰鏈嶅姟鍣ㄩ氱煡緇欏鎴風鐨勩備篃灝辨槸璇達紝鍦≦Q娓告垙鐨勬湰鍦版枃浠朵腑錛屽叿浣撶殑澶у巺鏈嶅姟鍣ㄨ繛鎺P鍜岀鍙d俊鎭槸娌℃湁淇濆瓨鐨勩傚ぇ鍘呮湇鍔″櫒鐨勪富瑕佷綔鐢ㄦ槸鍚戠帺瀹跺彂閫佹父鎴忔埧闂村垪琛ㄤ俊鎭紝榪欎簺淇℃伅鍖呮嫭錛氭瘡涓父鎴忔埧闂寸殑綾誨瀷錛屽悕縐幫紝鍦ㄧ嚎浜烘暟錛岃繛鎺ュ湴鍧浠ュ強鍏跺畠濡傛父鎴忓府鍔╂枃浠禪RL鐨勪俊鎭備粠鐣岄潰涓婄湅鐨勮瘽錛屽ぇ鍘呮湇鍔″櫒灝辨槸鎴戜滑杈撳叆鐢ㄦ埛鍚嶅拰瀵嗙爜騫舵牎楠岄氳繃鍚庤繘鍏ョ殑娓告垙鎴塊棿鍒楄〃鐣岄潰銆傚ぇ鍘呮湇鍔″櫒錛屼富瑕佹湁浠ヤ笅鍔熻兘錛氫竴鏄悜褰撳墠鐜╁騫挎挱鍚勪釜娓告垙鎴塊棿鍦ㄧ嚎浜烘暟淇℃伅錛涗簩鏄彁渚涙父鎴忕殑鐗堟湰浠ュ強涓嬭澆鍦板潃淇℃伅錛涗笁鏄彁渚涘悇涓父鎴忔埧闂存湇鍔″櫒鐨勮繛鎺P鍜岀鍙d俊鎭紱鍥涙槸鎻愪緵娓告垙甯姪鐨刄RL淇℃伅錛涗簲鏄彁渚涘叾瀹冩父鎴忚緟鍔╁姛鑳姐備絾鍦ㄨ繖浼楀鐨勫姛鑳戒腑錛屾湁涓鐐規槸鏈涓烘牳蹇冪殑錛屽嵆錛氫負鐜╁鎻愪緵榪涘叆鍏蜂綋鐨勬父鎴忔埧闂寸殑閫氶亾錛岃鐜╁欏哄埄榪涘叆鍏舵榪涘叆鐨勬父鎴忔埧闂淬傜帺瀹舵牴鎹悇涓父鎴忔埧闂村湪綰夸漢鏁幫紝鍒ゅ畾鑷繁榪涘叆鍝竴涓埧闂達紝鐒跺悗鍙屽嚮鏈嶅姟鍣ㄥ垪琛ㄤ腑鐨勬煇涓父鎴忔埧闂村悗鐜╁寮濮嬭繘鍏ユ父鎴忔埧闂存湇鍔″櫒銆?br>銆銆娓告垙鎴塊棿鏈嶅姟鍣細娓告垙鎴塊棿鏈嶅姟鍣紝鍏蜂綋鍦拌灝辨槸濡?#8220;鏂楀湴涓?”錛?#8220;鏂楀湴涓?”榪欐牱鐨勬父鎴忔埧闂淬傛父鎴忔埧闂存湇鍔″櫒鎵嶆槸鍏蜂綋鐨勮礋璐f墽琛屾父鎴忕浉鍏抽昏緫鐨勬湇鍔″櫒銆傝繖鏍風殑娓告垙閫昏緫鍒嗕負涓ゅぇ綾伙細涓綾繪槸閫氱敤鐨勬父鎴忔埧闂撮昏緫錛屽錛氳繘鍏ユ埧闂達紝紱誨紑鎴塊棿錛岃繘鍏ユ瀛愶紝紱誨紑妗屽瓙浠ュ強鍦ㄦ埧闂村唴璇磋瘽絳夛紱絎簩綾繪槸娓告垙妗屽瓙閫昏緫錛岃繖涓氨鏄悇縐嶄笉鍚岀被鍨嬫父鎴忕殑涓昏鍖哄埆涔嬪浜嗭紝姣斿鏂楀湴涓諱腑鐨勫彨鍦頒富鎴栦笉鍙湴涓葷殑閫昏緫絳夛紝褰撶劧錛屾父鎴忔瀛愰昏緫閲屼篃鍖呮嫭鏈夐氱敤鐨勫悇涓父鎴忛噷閮藉瓨鍦ㄧ殑娓告垙閫昏緫錛屾瘮濡傚湪妗屽瓙鍐呰璇濈瓑銆傛諱箣錛屾父鎴忔埧闂存湇鍔″櫒鎵嶆槸鐪熸璐熻矗鎵ц娓告垙鍏蜂綋閫昏緫鐨勬湇鍔″櫒銆?br>銆銆榪欓噷鎻愬埌鐨勪笁綾繪湇鍔″櫒錛屾垜鍧囬噰鐢ㄧ殑鏄畬鎴愮鍙fā鍨嬶紝姣忎釜鏈嶅姟鍣ㄦ渶澶氳繛鎺ユ暟鐩槸5000浜猴紝浣嗘槸錛屾垜鍦ㄦ父鎴忔埧闂存湇鍔″櫒涓婁綔浜嗛昏緫灞傜殑闄愬畾錛屾渶澶氬彧鍏佽300浜哄悓鏃跺湪綰褲傚叾浠栦袱涓湇鍔″櫒浠嶇劧鍏佽鏈澶?000浜虹殑鍚屾椂鍦ㄧ嚎銆傚鏋滄寜鐓ц繖鏍風殑緇撴瀯鏉ヨ璁★紝閭d箞瑕佸疄鐜扮櫨涓囦漢鐨勫悓鏃跺湪綰垮氨搴旇鏄繖鏍鳳細棣栧厛鏄ぇ鍘咃紝1000000/5000錛?00銆備篃灝辨槸璇達紝鑷沖皯瑕?00鍙板ぇ鍘呮湇鍔″櫒錛屼絾閫氬父鎯呭喌涓嬶紝鑰冭檻鍒板疄闄呬嬌鐢ㄦ椂鏈嶅姟鍣ㄧ殑澶勭悊鑳藉姏鍜岃礋杞芥儏鍐碉紝搴旇鑷沖皯鍑嗗250鍙板乏鍙崇殑澶у巺鏈嶅姟鍣ㄧ▼搴忋傚彟澶栵紝鍏蜂綋鐨勫悇縐嶇被鍨嬬殑娓告垙鎴塊棿鏈嶅姟鍣ㄩ渶瑕佸灝戯紝灝辮鏍規嵁褰撳墠鐜╁悇縐嶇被鍨嬫父鎴忕殑鐜╁鏁扮洰鍒嗗埆璁$畻浜嗭紝姣斿鏂楀湴涓繪渶澶氭槸鍗佷竾浜哄悓鏃跺湪綰匡紝姣忓彴鏈嶅姟鍣ㄦ渶澶氬厑璁?00浜哄悓鏃跺湪綰匡紝閭d箞闇瑕佺殑鏂楀湴涓繪湇鍔″櫒鏁扮洰灝卞簲璇ヤ笉灝戜簬錛?00000/300=333錛屽噯澶囧緱鍏呭垎涓鐐癸紝灝辮鍑嗗350鍙版枟鍦頒富鏈嶅姟鍣ㄣ?br>銆銆闄ゆ甯哥殑鐜╁榪炴帴澶栵紝榪樿鑰冭檻鍒幫細
銆銆瀵逛簬鐧婚檰鏈嶅姟鍣紝浼氭湁250鍙板ぇ鍘呮湇鍔″櫒榪炴帴鍒版瘡涓櫥闄嗘湇鍔″櫒涓婏紝榪欐槸濮嬬粓閮借淇濇寔鐨勮繛鎺ワ紱
銆銆鑰屽浜庡ぇ鍘呮湇鍔″櫒鑰岃█錛屽鏋滀粎浠呮湁鏂楀湴涓昏繖涓綾葷殑鏈嶅姟鍣紝灝辮鏈?50澶氫釜榪炴帴涓庡悇涓ぇ鍘呮湇鍔″櫒濮嬬粓淇濇寔鐫銆傛墍浠ヤ粠榪欎竴鐐圭湅錛屾垜鐨勭粨鏋勫湪鏌愪簺鏂歸潰榪樺瓨鍦ㄧ潃闇瑕佹敼榪涚殑鍦版柟錛屼絾鏍稿績鎬濇兂鏄細灝藉揩鍦版彁渚涚敤鎴風櫥闄嗙殑閫熷害錛屽敖鍙兘鏂逛究鍦拌鐜╁榪涘叆娓告垙涓?

]]>
A Reusable Windows Socket Server Class With C++http://m.shnenglu.com/twzheng/articles/SSC.html璋枃鏀?/dc:creator>璋枃鏀?/author>Tue, 22 May 2007 16:12:00 GMThttp://m.shnenglu.com/twzheng/articles/SSC.htmlhttp://m.shnenglu.com/twzheng/comments/24653.htmlhttp://m.shnenglu.com/twzheng/articles/SSC.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/24653.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/24653.html闃呰鍏ㄦ枃

]]>
鎮ㄤ篃浣跨敤鎵樼C++鍚楋紵http://m.shnenglu.com/twzheng/articles/24396.html璋枃鏀?/dc:creator>璋枃鏀?/author>Sat, 19 May 2007 09:36:00 GMThttp://m.shnenglu.com/twzheng/articles/24396.htmlhttp://m.shnenglu.com/twzheng/comments/24396.htmlhttp://m.shnenglu.com/twzheng/articles/24396.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/24396.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/24396.html鎮ㄤ篃浣跨敤鎵樼C++鍚楋紵
鎽樿嚜錛?a class=headermaintitle id=Header1_HeaderTitle >娌愭灚灝忕瓚 錛堝崥瀹㈠洯鍗氬錛?br>
杞悜.NET鍚庯紝鎵嬪ご涓婂線寰浠嶆湁鏃х殑妯″潡瑕侀噸鐢ㄣ備篃璁歌繖浜涙ā鍧楁槸Delphi鍐欑殑錛屼篃璁告槸C/C++鍐欑殑錛屾垨鑰呮槸鍏跺畠緙栫▼璇█……涓轟簡鑳芥妸瀹冧滑縐繪鍒?NET涓嬶紝鎴栬呮槸鍦?NET涓皟鐢紝To be or not to be, that is a question銆?br>銆銆鍦ㄨ繖閲岋紝鎴戠瑪璁頒簡鍑犱釜鍦ㄥ伐浣滀腑閬囧埌鐨勫嚑涓満鏅備笉榪囷紝榪欓噷涓嶅寘鎷畬鍏ㄤ嬌鐢–#鏉ラ噸鍐欏師鏉ョ敤C++緙栧啓鐨勭▼搴忚繖縐嶅彉鎬佺殑闇姹傘傚綋浣犺瑕佹眰鍋氳繖縐嶄簨鐨勬椂鍊欙紝璇蜂笁鎬濊屽悗琛?#8230;…榪欑畝鐩存槸縐嶉潪浜虹殑鎶樼(銆?br>
鎮ㄤ篃浣跨敤鎵樼C++鍚楋紵濡傛矏鏋灄

銆銆鍦烘櫙涓錛氬湪.NET涓皟鐢╓indowsAPI鎴朌LL銆?br>
銆銆榪欐槸姣旇緝鏅亶鐨勯渶姹傘備竴鑸潵璇達紝綆鍗曠殑鍑芥暟璋冪敤錛屽ぇ鍙洿鎺ョ敤C#/VB.NET錛岀粡榪嘍llImport灞炴у寘瑁呭嚭鍑芥暟鏉ヨ皟鐢ㄣ傚錛?
[DllImport("KERNEL32.DLL", EntryPoint="MoveFileW",  SetLastError=true,
CharSet
=CharSet.Unicode, ExactSpelling=true,
CallingConvention
=CallingConvention.StdCall)]
public static extern bool MoveFile(String src, String dst);


銆銆鐢變簬WindowsAPI鐢ㄥ埌鐨勪漢瀹炲湪鏄錛屽洜姝ゆ湁涓涓笓闂ㄧ殑wiki绔欑偣錛屾敹闆嗚繖鏂歸潰鐨勮祫鏂欙細http://www.pinvoke.net/錛屽浜庡父鐢ㄧ殑鍑芥暟鐢氳嚦鏈夊畬鏁寸殑搴旂敤渚嬪瓙鍜屽府鍔┿傚綋鐒訛紝濡傛灉浣犳湁鐩稿簲鐨勮祫鏂欏拰渚嬪瓙錛屼綘涔熷彲浠ヨ礎鐚綘鐨勫姏閲忥紝緇欏叾瀹冧漢甯姪銆?br>
 銆銆鍦烘櫙浜?/strong>錛氱敤鎵樼C++鍖呰鐜版湁鐨凞LL錛屼緵C#璋冪敤

銆銆褰撳嚱鏁扮殑鍙傛暟鎴栬繑鍥炲兼瘮杈冨鏉傦紝鎴栧嚱鏁版瘮杈冨鐨勬椂鍊欙紝榪欑鏂規硶瀵逛笌浜烘潵璇達紝瀹炲湪鏄竴涓姌紓ㄣ傚父甯歌繖浜涙帴鍙e拰瀹氫箟灝辮鐢ㄦ帀鍑犲崈琛岀殑浠g爜錛岃屼笖榪樹笉鑳戒繚璇佹槸姝g‘鐨勩傝繖浜涢敊璇線寰鍦ㄨ繍琛屾椂鎵嶈兘鏄劇幇鍑烘潵錛岀敋鑷蟲湁浜涢敊璇細寮曡搗鍐呭瓨娉勬紡錛屾垨鍏跺畠鏇翠負闅愯斀鐨勯敊璇?br>銆銆鍦ㄨ繖縐嶆儏鍐典笅錛屼嬌鐢–++/Managed浠g爜鏉ュ寘瑁咃紝灝辨垚浜嗘渶鍚堢悊鐨勯夋嫨銆傚洜涓烘墭綆++浠g爜鍙互鐩存帴寮曠敤鍘熸湁鐨勫ご鏂囦歡錛岀洿鎺ヨ皟鐢ㄩ潪鎵樼鍑芥暟錛岃屼笉闇瑕佸0鏄庛傝繖鏍鳳紝鏃㈠噺灝戜簡宸ヤ綔閲忥紝鍙堥伩鍏嶅紩鍏ラ敊璇傜己鐐規槸錛岃繖縐嶆柟娉曚細澧炲姞涓涓狣LL銆?span style="COLOR: #ff0000">瑕佹敞鎰忕殑鏄墭綆″瓧絎︿覆鍜岄潪鎵樼瀛楃涓叉槸鏈夊尯鍒殑錛屽茍闇瑕佽漿鎹紙鐗瑰埆瑕佹敞鎰忕殑Unicode瀛楃涓插拰澶氬瓧鑺傚瓧絎︿覆鐨勮漿鎹級銆?br>
銆銆浠嶄互MoveFile涓轟緥鍚э紝榪欐牱姣旇緝綆鍗曪細

#include <windows.h>
#include 
<vcclr.h>

using namespace System;

namespace wrapper
{
    
public ref class ApiWrapper {
    
public:
        
bool static MoveFile(String ^ lpExistingFileName, String ^ lpNewFileName )
        
{
            pin_ptr
<const wchar_t> src = PtrToStringChars(lpExistingFileName);
            pin_ptr
<const wchar_t> dst = PtrToStringChars(lpNewFileName);
            
return ::MoveFile(src, dst);
        }

    }
;
}

銆銆鐒跺悗鍦–#涓紝寮曠敤涓婇潰浠g爜鐢熸垚鐨凞LL鏂囦歡錛屽氨鍙互鐩存帴璋冪敤浜嗭細
wrapper.ApiWrapper.MoveFile(@"c:\debug.log"@"c:\debug.txt");

銆銆鍋囧鍘熸湁鐨勪唬鐮佹槸鍩轟簬COM鐨勶紝閭d箞澶ソ浜嗭紝VisualStudio絳塈DE浼氳嚜鍔ㄧ敓鎴愪竴涓敤浜庡寘瑁呯殑dll錛屼緵浣犺皟鐢ㄣ傚綋鐒跺洜鐗規畩闇瑕佽屾墜宸ョ紪鐮佺殑鏄彟涓鍥炰簨銆?br>
銆銆鍦烘櫙涓?/strong>錛氱幇鏈塁++鍘熶唬鐮侊紝鍖呰鍚庝緵C#璋冪敤銆?br>
銆銆C++鐨勫師浠g爜錛屽疄闄呬笂鍙互鐩存帴緙栬瘧鎴愭墭綆′唬鐮併侻FC涔熷ソATL涔熷ソ……榪欐牱鐪嬭搗鏉ュ湪.NET涓渶寮哄ぇ鐨勭紪紼嬭璦灝辨槸C++浜嗭細瀹冧笉浠呭彲浠ョ紪鍐欐墭綆$▼搴忥紝鐢氳嚦鍙互灝嗘爣鍑咰++鐨勪唬鐮佷篃緙栬瘧鎴愭墭綆$▼搴忥紒鍏跺疄VC++鏈寮哄ぇ鐨勫湴鏂逛笉姝㈠姝わ紝瀹冭繕鍦ㄤ簬鑳藉緙栧啓娣峰悎浜嗘墭綆″拰闈炴墭綆$殑浠g爜鐨勭▼搴忥紒錛侊紒榪欐牱鏈澶х殑濂藉涓嶄粎鍙互灝嗗叧閿唬鐮佺洿鎺ョ紪璇戞垚闈炴墭綆$殑浠g爜錛岃繕鍙互閬垮厤琚弽緙栬瘧銆?br>銆銆
銆銆鍋囪鐜版湁C++浠g爜濡備笅錛?br>
class UnmanagedClass {
public:
    LPCWSTR GetPropertyA() 
return L"Hello!"; }
    
void MethodB( LPCWSTR ) {}
}
;
銆銆鎴戜滑鍙鍐嶅鍔犱竴涓寘瑁呯被鍒板伐紼嬫枃浠朵腑錛?
namespace wrapper
{
    
public ref class ManagedClass {
    
public:
        
// Allocate the native object on the C++ Heap via a constructor
        ManagedClass() : m_Impl( new UnmanagedClass ) {}

        
// Deallocate the native object on a destructor
        ~ManagedClass() {
            delete m_Impl;
        }


    
protected:
        
// Deallocate the native object on the finalizer just in case no destructor is called
        !ManagedClass() {
            delete m_Impl;
        }


    
public:
        property String 
^  get_PropertyA {
            String 
^ get() {
                
return gcnew String( m_Impl->GetPropertyA());
            }

        }


        
void MethodB( String ^ theString ) {
            pin_ptr
<const WCHAR> str = PtrToStringChars(theString);
            m_Impl
->MethodB(str);
        }


    
private:
        UnmanagedClass 
* m_Impl;
    }
;
}

銆銆鐒跺悗錛屾敼鍙樼紪璇戦夐」涓?#8220;浣跨敤鍏叡璇█鎵╁睍 /clr”灝卞彲浠ヤ簡銆傝繖鏍鳳紝鎴戜滑鎶婁唬鐮佺紪璇戞垚DLL鏂囦歡灝卞彲浠ヤ緵.NET鍏跺畠璇█璋冪敤浜嗐?br>銆銆鏈鍚庯紝C#涓彲浠ヨ薄濡備笅鐨勪唬鐮佷竴鏍瘋皟鐢–++綾諱簡錛?
ManagedClass mc = new ManagedClass();
mc.MethoB(
"Hello");
string s = mc.get_PropertyA;

銆銆鍦烘櫙鍥?/strong>錛氬浣曞湪鎵樼C++浠g爜涓販鍚堟墭綆″拰闈炴墭綆′唬鐮?br>
銆銆寰堢畝鍗曪紝鍙浠?pragma unmanaged緙栬瘧鎸囩ず寮濮嬬殑紼嬪簭錛屼竴鐜囩紪璇戞垚闈炴墭綆′唬鐮侊紱瑕佹兂鎭㈠鎴愭墭綆′唬鐮侊紝鍙浣跨敤#pragma managed灝卞彲浠ヤ簡銆傚錛?br>銆銆
#pragma unmanaged

#include 
<iostream>
using namespace std;

template
<typename T>
void f(T t){
    cout 
<< t << endl;
}


#pragma managed

using namespace System;

void m(String ^ s){
    Console::WriteLine(s);
}


void main(){
    f(
"Hello");
    m(
"World");
}
銆銆
銆銆鐢熸垚exe鏂囦歡鍚庯紝鐢ㄥ弽緙栬瘧紼嬪簭鏌ョ湅 f 鍑芥暟錛?
[PreserveSig, MethodImpl(MethodImplOptions.Unmanaged, MethodCodeType=MethodCodeType.Native), SuppressUnmanagedCodeSecurity]
public static unsafe void modopt(CallConvCdecl) f<char const *>(sbyte modopt(IsSignUnspecifiedByte) modopt(IsConst)*);
銆銆
銆銆鐪嬩笉鍒版簮鐮侊紝鑰屾柟娉曞睘鎬ф爣璁頒負Unmanaged銆?br>銆銆濡傛灉娌℃湁鍔犱笂#pragma unmanaged錛屽弽緙栬瘧寰楀埌鐨?f 鍑芥暟涓猴細
internal static unsafe void modopt(CallConvCdecl) f<char const *>(sbyte modopt(IsSignUnspecifiedByte) modopt(IsConst)* t)
{
      std.basic_ostream
<char,std::char_traits<char> >.<<(std.operator<<<struct std::char_traits<char> >(*((basic_ostream<char,std::char_traits<char> >* modopt(IsImplicitlyDereferenced)*&__imp_std.cout), t), (basic_ostream<char,std::char_traits<char> >* modopt(IsImplicitlyDereferenced) modopt(CallConvCdecl) *(basic_ostream<char,std::char_traits<char> >* modopt(IsImplicitlyDereferenced))) __unep@?endl@std@@$$FYAAAV?$basic_ostream@DU?$char_traits@D@std@@@1@AAV21@@Z);
}

銆銆鍏朵腑鐨勫嚱鏁板唴瀹逛竴鐩簡鐒躲傚鏋滀綘鐨勫嚱鏁版病鏈夎皟鐢╫perator絳変笉濂界悊瑙g殑綾誨簱錛岄偅涔堝弽緙栬瘧鍑烘潵鐨勪唬鐮佺畝鐩村拰婧愮爜娌″樊鍒?nbsp;

銆銆寮蹇冧竴鍒?/strong>錛氭垜鍙細C++涓嶆噦.NET涓嶆噦C#錛屾庝箞緙栧啓.NET紼嬪簭錛?br>
銆銆寰堢畝鍗曪紝浣犵収鏍風敤浣犵殑C++鍐欎綘鐨勭▼搴忥紝鐒跺悗嫻嬭瘯娌℃湁閿欒鍚庯紝灝嗙紪璇戦夐」鏀逛負/clr錛屽ソ浜嗭紝Rebuild錛屼綘鐨勭▼搴忕幇鍦ㄦ槸.NET浜嗐?br>
銆銆鎭舵悶錛?#8220;鎴戞兂闂竴涓嬶紝鍦ㄨ兘灝嗙幇鏈夌殑C錛嬶紜浠g爜鐩存帴榪涜灝佽錛岃C錛冭繘琛岃皟鐢紝鑰屼笉鏄幓璋冪敤DLL錛屼篃灝辨槸涓嶇敓鎴怐LL錛屽氨鍦–錛冧笅鑳界洿鎺ヨ皟鐢╒C鐨勫伐紼嬫簮鏂囦歡涓嶏紵”

銆銆鎴戞兂錛屾彁闂殑浜烘槸涓嶆槸鎸囷紝鐜版湁c++婧愮爜錛屼絾涓嶆兂璐瑰姴鍘昏漿鎹㈡垚C#婧愮爜錛屼絾鍙堟兂鑳戒笌C#涓璧風紪璇戙?br>銆銆浜庢槸鎴戝氨緇欎簡涓涓瀬鍏跺彉鎬佺殑鏂規硶錛屼笉榪囷紝涓漢鏄笉寤鴻浣跨敤榪欑鍙樻佺殑鏂規硶鍟娿傛柟娉曞涓嬶細
銆銆錛戙鍏堝皢C++婧愮爜錛屾敼鐢–LR緙栬瘧閫夐」錛岀紪璇戞垚.NET鐨凙ssembly錛圖LL鏂囦歡錛夈?
銆銆錛掋鐒跺悗鐢╮eflector絳夊弽緙栬瘧杞歡錛屽弽緙栬瘧鎴怌#浠g爜錛屽茍瀵煎嚭錛坮eflector鏈変笓闂ㄧ殑瀵煎嚭鎻掍歡錛夈?
銆銆錛撱灝嗗鍑虹殑C#浠g爜錛屾坊鍔犱笂鏂板啓鐨凜#浠g爜涓璧風紪璇戙?
銆銆
銆銆榪欑鏂規硶鐢熸垚鐨勪唬鐮佸緢鏄亹鎬栵紝寮虹儓寤鴻涓嶈鎶奀++婧愮爜灝辮繖涔堜涪浜嗭紝鍚﹀垯鍚庢灉鑷礋銆?br>
銆銆鍦烘櫙浜?/strong>錛氫笉鎯寵DLL錛岃兘涓嶈兘鐩存帴鎶奀++婧愪唬鐮佷笌C#婧愪唬鐮佷竴璧風紪璇戞垚涓涓崟鐙殑Assembly鍛紵

銆銆褰撶劧鏄彲浠ョ殑銆傚叿浣撳弬瑙侊細璁〤++浠g爜涓嶤#浠g爜涓璧風敓鎴愪竴涓崟涓鐨凙ssembly

-------
閮ㄤ喚渚嬪瓙鏉ヨ嚜MSDN.



]]>
Control.KeyPress 浜嬩歡http://m.shnenglu.com/twzheng/articles/24252.html璋枃鏀?/dc:creator>璋枃鏀?/author>Wed, 16 May 2007 16:02:00 GMThttp://m.shnenglu.com/twzheng/articles/24252.htmlhttp://m.shnenglu.com/twzheng/comments/24252.htmlhttp://m.shnenglu.com/twzheng/articles/24252.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/24252.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/24252.html闃呰鍏ㄦ枃

]]>
.NET Remotinghttp://m.shnenglu.com/twzheng/articles/24074.html璋枃鏀?/dc:creator>璋枃鏀?/author>Sun, 13 May 2007 16:30:00 GMThttp://m.shnenglu.com/twzheng/articles/24074.htmlhttp://m.shnenglu.com/twzheng/comments/24074.htmlhttp://m.shnenglu.com/twzheng/articles/24074.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/24074.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/24074.html.NET Remoting
By Mark Strawmyer 

[婧怾 http://www.developer.com/net/cplus/article.php/10919_1479761_1

The last two Nuts and Bolts articles focused on database related topics. This month we'll change gears and focus on something different. The focus of this month's article will be .NET remoting. We'll discuss what is .NET Remoting, how it compares to DCOM and Web services, and go through an example.

What is .NET Remoting?

.NET Remoting is an enabler for application communication. It is a generic system for different applications to use to communicate with one another. .NET objects are exposed to remote processes, thus allowing interprocess communication. The applications can be located on the same computer, different computers on the same network, or even computers across separate networks.

.NET Remoting versus Distributed COM

In the past interprocess communication between applications was handled through Distributed COM, or DCOM. DCOM works well and the performance is adequate when applications exist on computers of similar type on the same network. However, DCOM has its drawbacks in the Internet connected world. DCOM relies on a proprietary binary protocol that not all object models support, which hinders interoperability across platforms. In addition, have you tried to get DCOM to work through a firewall? DCOM wants to communicate over a range of ports that are typically blocked by firewalls. There are a ways to get it to work, but they either decrease the effectiveness of the firewall (why bother to even have the firewall if you open up a ton of ports on it), or require you to get a firewall that allows support for binary traffic over port 80.

.NET Remoting eliminates the difficulties of DCOM by supporting different transport protocol formats and communication protocols. This allows .NET Remoting to be adaptable to the network environment in which it is being used.

.NET Remoting versus Web Services

Unless you have been living in a cave, or are way behind in your reading, you have probably read something about Web services. When you read the description of .NET Remoting it may remind you a lot of what you're read about Web services. That is because Web services fall under the umbrella of .NET Remoting, but have a simplified programming model and are intended for a wide target audience.

Web services involve allowing applications to exchange messages in a way that is platform, object model, and programming language independent. Web services are stateless and know nothing about the client that is making the request. The clients communicate by transferring messages back and forth in a specific format known as the Simple Object Access Protocol, or SOAP. (Want to get some funny looks in the hallway? Stand around in the hallway near the marketing department with your colleagues and discuss the benefits of using SOAP).

The following list outlines some of the major differences between .NET Remoting and Web services that will help you to decide when to use one or the other:

  • ASP.NET based Web services can only be accessed over HTTP. .NET Remoting can be used across any protocol.
  • Web services work in a stateless environment where each request results in a new object created to service the request. .NET Remoting supports state management options and can correlate multiple calls from the same client and support callbacks.
  • Web services serialize objects through XML contained in the SOAP messages and can thus only handle items that can be fully expressed in XML. .NET Remoting relies on the existence of the common language runtime assemblies that contain information about data types. This limits the information that must be passed about an object and allows objects to be passed by value or by reference.
  • Web services support interoperability across platforms and are good for heterogeneous environments. .NET Remoting requires the clients be built using .NET, or another framework that supports .NET Remoting, which means a homogeneous environment.

Channels

Remote objects are accessed through Channels. Channels physically transport the messages to and from remote objects. There are two existing channels TcpChannel and HttpChannel. Their names give away the protocols that they use. In addition, the TcpChannel or HttpChannel can be extended, or a new channel created if you determine the existing channels do not meet your needs.

Create a Remotable Object

 

A remotable object is nothing more than an object that inherits from MarshalByRefObject. The following sample demonstrates a simple class to expose the omnipresent hello world. This object exposes a single method HelloWorld that will return a string. The only values that can be returned from methods are the classes in the .NET Framework that are serializable such as string and DataSet. In addition, if you need to return a user-defined object then the object needs to be marked as serializable.

 

Create a new C# class library project. Add a class called SampleObject and put in the following code. Add a reference to System.Runtime.Remoting in the project, otherwise the TcpChannel will not be found. Compile the class to make sure you have everything correct.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace CodeGuru.Remoting
{
/// <remarks>
/// Sample object to demonstrate the use of .NET Remoting.
/// </remarks>
public class SampleObject : MarshalByRefObject
{
/// <summary>
/// Constructor
/// </summary> 
public SampleObject()
{
}

/// <summary>
/// Return a hello message
/// </summary>
/// <returns>Hello world message</returns>
public string HelloWorld()
{
return "Hello World!";
}
}
}

Create a Server To Expose the Remotable Object

We need to create a server object that will act as a listener to accept remote object requests. For this example we will use the TCP/IP channel. We first create an instance of the channel and then register it for use by clients at a specific port. The service can be registered as WellKnownObjectMode.SingleCall, which results in a new instance of the object for each client, or as WellKnownObjectMode.Singleton, which results in one instance of the object used for all clients.

It is not necessary to create the server listener if you are planning to use IIS. For obvious reasons, IIS only supports the use of the HttpChannel. Create a virtual directory for your application and then put code to register your service in the Application_Start event.

For our example, we'll go ahead and create a server listener in case you don't have IIS. Since the service needs to be bound to an available port, for our example I chose 8080, which is a port that I know to be unused on my computer. You may need to choose a different port depending upon what ports you have available. To see a list of the used ports on your computer open a command prompt and issue the command "netstat --a". It may produce a long listing so make sure the command prompt buffer sizes are set to allow scrolling. Compile the class to make sure you have everything correct.

Create a new C# console application project. Add a class called SampleServer and paste in the following code. Add a reference to System.Runtime.Remoting in the project, otherwise the TcpChannel will not be found. In addition, add a reference to the project containing the SampleObject, otherwise the code will not compile because it won't know how to find a reference to SampleObject.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace CodeGuru.Remoting
{
/// <remarks>
/// Sample server to demonstrate the use of .NET Remoting.
/// </remarks>
public class SampleServer
{
public static int Main(string [] args)
{
// Create an instance of a channel
TcpChannel channel = new TcpChannel(8080);
ChannelServices.RegisterChannel(channel);
// Register as an available service with the name HelloWorld
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(SampleObject),
"HelloWorld",
WellKnownObjectMode.SingleCall );
System.Console.WriteLine("Press the enter key to exit...");
System.Console.ReadLine();
return 0;
}
}
}

Create a Client To Use the Remotable Object

Now that we have our remotable object and a server object to listen for requests, let's create a client to use it. Our client will be very simple. It will connect to the server, create an instance of the object using the server, and then execute the HelloWorld method.

Create a new C# console application project. Add a class called SampleClient and paste in the following code. Add a reference to System.Runtime.Remoting in the project, otherwise the TcpChannel will not be found. In addition, add a reference to the project containing the SampleObject, otherwise the code will not compile because it won't know how to find a reference to SampleObject. Compile the class to make sure you have everything correct.

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
namespace CodeGuru.Remoting
{
/// <remarks>
/// Sample client to demonstrate the use of .NET Remoting.
/// </remarks>
public class SampleClient
{
public static int Main(string [] args)
{
// Create a channel for communicating w/ the remote object
// Notice no port is specified on the client
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
// Create an instance of the remote object
SampleObject obj = (SampleObject) Activator.GetObject(
typeof(CodeGuru.Remoting.SampleObject),
"tcp://localhost:8080/HelloWorld" );
// Use the object
if( obj.Equals(null) )
{
System.Console.WriteLine("Error: unable to locate server");
}
else
{
Console.WriteLine(obj.HelloWorld());
}
return 0;
}
}
}

Test the Remoting Sample

Once you have created the projects and successfully compiled each of them you are ready to try it out. Assuming you chose a free TCP/IP port for the service, start the server executable. After the server successfully starts it will result in a console window being displayed with the message "Press the enter key to exit". The server is listening so you are now ready to run the client. Executing the client should result in "Hello World!" being displayed in a separate console window. The client window will then close while the server remains open and available.

If you have multiple computers available to you on a network you could execute the server on one machine and the client on another just to prove to yourself that it really is remoting. In order to run on separate machines you would need to change the reference to localhost in the sample client to point to the appropriate location.

Summary

.NET Remoting is a powerful way to enable interprocess communication. It is more complicated to program against than Web services. You need to decide for yourself whether your standard architecture is to use .NET Remoting or Web services.

Future Columns

The next column will be on the use of encryption in the .NET framework. We'll take a look at some of the encryption algorithms available in the framework and ways to use them. If you have a particular topic in mind please email me at mstrawmyer@crowechizek.com

About the Author

Mark Strawmyer, MCSD, MCSE (NT4/W2K), MCDBA is a Senior Architect of .NET applications for large and mid-size organizations. Mark is a technology leader with Crowe Chizek in Indianapolis, Indiana. He specializes in architecture, design and development of Microsoft-based solutions. You can reach Mark at mstrawmyer@crowechizek.com.



]]>
鍏充簬.net濮旀墭鐨勪竴綃囧鏂?/title><link>http://m.shnenglu.com/twzheng/articles/delegate.html</link><dc:creator>璋枃鏀?/dc:creator><author>璋枃鏀?/author><pubDate>Sat, 12 May 2007 12:00:00 GMT</pubDate><guid>http://m.shnenglu.com/twzheng/articles/delegate.html</guid><wfw:comment>http://m.shnenglu.com/twzheng/comments/23997.html</wfw:comment><comments>http://m.shnenglu.com/twzheng/articles/delegate.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/twzheng/comments/commentRss/23997.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/twzheng/services/trackbacks/23997.html</trackback:ping><description><![CDATA[<p><strong>鍏充簬.net濮旀墭鐨勪竴綃囧鏂?/strong><br><br>浣滆咃細TomMax (絎戞湜浜虹敓) 鍑哄錛歝sdn community </p> <p>鏈夎澶氫漢闂殑錛?Net涓殑濮旀墭浠ュ強浜嬩歡澶勭悊銆傛垜鎷跨畝鍗曠殑渚嬪瓙璇存槑涓涓嬶紝鏄幇瀹炰腑鐨勪緥瀛愶細</p> <p>姣斿璇翠竴涓叕鍙革紙鍦烘櫙錛夛紝浣犳槸鑰佹澘錛屾墜涓嬫湁涓や釜鍛樺伐錛屽皬寮犲拰灝忕帇銆?br>浣犲懡浠ゅ皬鐜嬶紝濡傛灉灝忓紶鐜╂父鎴忥紝鍒欏皬鐜嬫墸鍘誨皬寮?00鍏冮挶銆?/p> <p>榪欏氨鏄幇瀹炰腑鐨勫鎵樸?/p> <p>瀹為檯涓婏紝鍦ㄥ啓紼嬪簭涓紝紼嬪簭鍛樺氨鏄佹澘錛屽皬寮犲拰灝忕帇灝辨槸涓や釜瀵硅薄銆傚皬寮犵帺娓告垙鏄竴涓柟娉曪紝灝忓紶榪樻湁涓涓父鎴忎簨浠訛紝浠栫帺娓告垙嬋鍙戣繖涓簨浠躲傝屽皬鐜嬪氨鏄簨浠跺鐞嗗璞★紝浠栬礋璐f妸灝忓紶鐨勯挶鎵i櫎500銆?/p> <p>鎵浠ワ紝濮旀墭鏈夊涓嬪嚑涓绱狅細<br>1 嬋鍙戜簨浠剁殑瀵硅薄--灝辨槸灝忓紶<br>2 澶勭悊瀵硅薄浜嬩歡鐨勫璞?-灝辨槸灝忕帇<br>3 瀹氫箟濮旀墭錛屽氨鏄綘璁╁皬鐜嬬洃瑙嗗皬寮犮?/p> <p>濡傛灉榪欎笁涓绱犻兘婊¤凍鐨勮瘽錛屽垯浣犲氨鍐欏嚭浜嗕竴涓畬鏁翠簨浠剁殑澶勭悊銆?/p> <p>涓嬮潰鏈変釜渚嬪瓙錛氬湪vs.net2003 C#鎺у埗鍙板簲鐢ㄧ▼搴忕紪杈戣繍琛屾垚鍔燂細<br>using System;</p> <p>namespace CSharpConsole<br>{<br> public class 鍦烘櫙<br> {<br>  [STAThread]<br>  public static void Main(string[] args)<br>  {<br>   Console.WriteLine("鍦烘櫙寮濮嬩簡....");<br>   // 鐢熸垚灝忕帇<br>   灝忕帇 w = new 灝忕帇();<br>   // 鐢熸垚灝忚處<br>   灝忓紶 z = new 灝忓紶();</p> <p>   // 鎸囧畾鐩戣<br>   z.PlayGame += new PlayGameHandler(w.鎵i挶);</p> <p>   // 寮濮嬬帺娓告垙<br>   z.鐜╂父鎴?);</p> <p>   console.writeline("鍦烘櫙緇撴潫...");<br>   Console.ReadLine();<br>  }<br> }</p> <p><br> // 璐熻矗鎵i挶鐨勪漢<br> public class 灝忕帇<br> {<br>  public 灝忕帇()<br>  {<br>   Console.WriteLine("鐢熸垚灝忕帇...");<br>  }</p> <p>  public void 鎵i挶(object sender,EventArgs e)<br>  {<br>   Console.WriteLine("灝忕帇錛氬ソ灝忓瓙錛屼笂鐝椂闂磋儐鏁㈢帺娓告垙...");<br>   Console.WriteLine("灝忕帇錛氱湅鐪嬩綘灝忓瓙鏈夊灝戦挶...");<br>   灝忓紶 f = (灝忓紶)sender;<br>   Console.WriteLine("灝忓紶鐨勯挶錛?" + f.閽?ToString());<br>   Console.WriteLine("寮濮嬫墸閽?.....");<br>   System.Threading.Thread.Sleep(500);<br>   f.閽?= f.閽?- 500;<br>   Console.WriteLine("鎵e畬浜?...鐜板湪灝忓紶榪樺墿涓嬶細" + f.閽?ToString());<br>  }<br> }</p> <p> // 濡傛灉鐜╂父鎴忥紝鍒欏紩鍙戜簨浠?br> public class 灝忓紶<br> {<br>  // 鍏堝畾涔変竴涓簨浠訛紝榪欎釜浜嬩歡琛ㄧず“灝忓紶”鍦ㄧ帺娓告垙銆?br>  public event PlayGameHandler PlayGame;<br>  // 淇濆瓨灝忓紶閽辯殑鍙橀噺<br>  private int m_Money;</p> <p>  public 灝忓紶()<br>  {<br>   Console.WriteLine("鐢熸垚灝忓紶....");<br>   m_Money = 1000; // 鏋勯犲嚱鏁幫紝鍒濆鍖栧皬寮犵殑閽便?br>  }</p> <p>  public int 閽?// 姝ゅ睘鎬у彲浠ユ搷浣滃皬寮犵殑閽便?br>  {<br>   get<br>   {<br>    return m_Money;<br>   }<br>   set<br>   {<br>    m_Money = value;<br>   }<br>  }</p> <p>  public void 鐜╂父鎴?)<br>  {<br>   Console.WriteLine("灝忓紶寮濮嬬帺娓告垙浜?....");<br>   Console.WriteLine("灝忓紶:CS濂界帺錛屽搱鍝堝搱錛?鎴戠帺.....");<br>   System.Threading.Thread.Sleep(500);<br>   System.EventArgs e = new EventArgs();<br>   OnPlayGame(e);<br>  }</p> <p>  protected virtual void OnPlayGame(EventArgs e)<br>  {<br>   if(PlayGame != null)<br>   {<br>    PlayGame(this,e);<br>   }<br>  }<br> }</p> <p> // 瀹氫箟濮旀墭澶勭悊紼嬪簭<br> public delegate void PlayGameHandler(object sender,System.EventArgs e);</p> <p>}<br></p> <img src ="http://m.shnenglu.com/twzheng/aggbug/23997.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/twzheng/" target="_blank">璋枃鏀?/a> 2007-05-12 20:00 <a href="http://m.shnenglu.com/twzheng/articles/delegate.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Windows鍑芥暟閿欒澶勭悊http://m.shnenglu.com/twzheng/articles/20519.html璋枃鏀?/dc:creator>璋枃鏀?/author>Sat, 24 Mar 2007 03:04:00 GMThttp://m.shnenglu.com/twzheng/articles/20519.htmlhttp://m.shnenglu.com/twzheng/comments/20519.htmlhttp://m.shnenglu.com/twzheng/articles/20519.html#Feedback0http://m.shnenglu.com/twzheng/comments/commentRss/20519.htmlhttp://m.shnenglu.com/twzheng/services/trackbacks/20519.html   Windows鍑芥暟甯哥敤鐨勮繑鍥炲肩被鍨?
        void
        BOOL:0,闈?,TURE,FALSE
        HANDLE:HANDLE,NULL,INVALID_HANDLE_VALID)
        PVOID:NULL,PVOID
        LONG/DWORD:鍏蜂綋鍑芥暟鑰屽畾
        ...
   Microsoft緙栬瘧浜嗕竴涓墍鏈夊彲鑳界殑閿欒浠g爜鍒楄〃錛屽茍涓斾負姣忎釜閿欒浠g爜鍒嗛厤浜嗕竴涓?2浣嶇殑鍙風爜. WinError.h澶存枃浠?澶х害2涓囧琛?鍖呭惈浜哅icorsoft瀹氫箟鐨勯敊璇唬鐮佸垪琛?
   褰撲竴涓猈indows鍑芥暟媯嫻嬪埌涓涓敊璇椂錛屽畠浼氫嬌鐢ㄧ嚎紼嬫湰鍦板瓨鍌?thread-local storage)鏈哄埗錛屽皢鐩稿簲鐨勯敊璇唬鐮佸彿鐮佷笌璋冪敤鐨勭嚎紼嬪叧鑱旇搗鏉?榪欏皢浣跨嚎紼嬭兘澶熶簰鐩哥嫭绔嬬殑榪愯,鑰屼笉浼氬獎鍝嶅悇鑷殑閿欒浠g爜.
   褰撳嚱鏁拌繑鍥炴椂錛屽畠鐨勮繑鍥炲煎氨鑳芥寚鏄庢槸鍚︽湁閿欒鍙戠敓錛岃嫢鏈変笖瑕佺‘瀹氭槸浠涔堥敊璇?灝遍渶瑕佽皟鐢―WORD GetLastError()鍑芥暟,瀹冭繑鍥炵嚎紼嬬殑32浣嶉敊璇唬鐮?Visual Studio鏈変竴涓狤rror Lookup紼嬪簭鍙敤灝嗛敊璇唬鐮佺殑鍙風爜鎹㈡垚鐩稿簲鏂囨湰鎻忚堪.Windows榪樻彁渚涗簡涓涓嚱鏁癋ormatMessage鍙互灝嗛敊璇唬鐮佽漿鎹㈡垚瀹冪殑鏂囨湰鎻忚堪.
DWORD FormatMessage(
  DWORD dwFlags,      // source and processing options
  LPCVOID lpSource,   // message source
  DWORD dwMessageId,  // message identifier
  DWORD dwLanguageId, // language identifier
  LPTSTR lpBuffer,    // message buffer
  DWORD nSize,        // maximum size of message buffer
  va_list *Arguments  // array of message inserts
);
  鎴戜滑涔熷彲浠ュ湪鑷繁鐨勫嚱鏁頒腑浣跨敤璇ユ満鍒?鍙渶瑕佷嬌鐢╒OID SetLastError(DWORD dwErrCode)鍑芥暟鍗沖彲,濡傛灉WinError.h涓殑浠諱綍浠g爜閮戒笉鑳芥紜湴鍙嶆槧璇ラ敊璇殑鎬ц川錛岄偅涔堝彲浠ュ垱寤轟綘鑷繁鐨勪唬鐮併傞敊璇唬鐮佺殑鍩熺殑鍒掑垎琛?
浣?nbsp;       31~30          29              28       27~16          15~0
鍐呭      涓ラ噸鎬?nbsp;     Microsoft/瀹㈡埛    淇濈暀     璁懼浠g爜      寮傚父浠g爜

鍚箟      0=鎴愬姛      0=MS瀹氫箟鐨勪唬鐮?nbsp;  蹇呴『鏄?   鐢盡S瀹氫箟       鐢盡S鎴栧鎴峰畾涔?br>          1=鍙傝?br>          2=璀﹀憡      1=瀹㈡埛瀹氫箟鐨勪唬鐮?br>          3=閿欒

娉?濡傛灉鍒涘緩鑷繁鐨勯敊璇唬鐮侊紝蹇呴『浣?9浣嶄負1.

]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
              欧美韩日精品| 99精品福利视频| 欧美精品在线一区二区三区| 久久精品日产第一区二区| 欧美一区二区黄色| 久久国产精品一区二区| 久久久久久**毛片大全| 久久先锋影音av| 欧美激情精品久久久久久免费印度 | 亚洲一区二区成人| 亚洲欧美一区二区三区在线| 午夜亚洲性色福利视频| 久久久久久久一区| 欧美日韩国产综合久久| 国产视频自拍一区| 亚洲精品久久久久中文字幕欢迎你| a91a精品视频在线观看| 亚洲淫性视频| 久久天天躁狠狠躁夜夜爽蜜月| 欧美aⅴ99久久黑人专区| 欧美日韩三级电影在线| 性欧美暴力猛交另类hd| 欧美v日韩v国产v| 欧美色123| 亚洲电影免费观看高清| 在线午夜精品| 美女诱惑黄网站一区| 99精品欧美一区二区蜜桃免费| 午夜免费电影一区在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美网站在线| 亚洲成人原创| 欧美在线不卡| 99精品欧美一区二区蜜桃免费| 欧美专区亚洲专区| 国产精品久久久久久久久免费桃花 | 精品二区视频| 亚洲欧美激情视频| 亚洲国产日韩欧美在线99| 亚洲一区二区三区免费在线观看| 久久亚洲欧美国产精品乐播| 国产精品超碰97尤物18| 亚洲免费成人av电影| 蜜臀91精品一区二区三区| 亚洲欧美日韩综合| 国产精品久久久久久久久| 日韩小视频在线观看| 欧美成人小视频| 欧美伊人影院| 国产精品三级视频| 亚洲天堂av在线免费观看| 老牛嫩草一区二区三区日本 | 日韩亚洲欧美综合| 欧美国产综合一区二区| 欧美一区在线视频| 国产综合精品| 奶水喷射视频一区| 久久久精品性| 亚洲国产成人porn| 欧美成人一区二区三区在线观看 | 国产精品亚洲综合久久| 亚洲主播在线| 亚洲在线视频一区| 国产嫩草影院久久久久| 欧美一区二区免费观在线| 亚洲自拍啪啪| 国产中文一区二区三区| 另类尿喷潮videofree| 久久亚洲精品伦理| 亚洲欧洲一区二区三区久久| 国产日韩精品入口| 欧美一级在线亚洲天堂| 日韩午夜av| 国产精品久久久久久久久借妻| 亚洲男人天堂2024| 欧美一区激情| 亚洲日韩欧美一区二区在线| 亚洲精品久久在线| 国产精品视频一二三| 久久久亚洲国产美女国产盗摄| 久久琪琪电影院| 亚洲美女91| 午夜精品影院| 最近中文字幕mv在线一区二区三区四区| 亚洲国产高清在线| 国产精品视频免费观看www| 久久综合伊人77777蜜臀| 欧美国产欧美亚州国产日韩mv天天看完整| 一区二区精品在线| 久久国产精品99国产| 亚洲免费成人av电影| 亚洲欧美日韩成人| 亚洲日韩欧美视频| 欧美一区二区三区免费视| 在线免费观看成人网| 亚洲美女黄网| 韩国一区电影| 亚洲精选大片| 狠狠综合久久av一区二区小说| 亚洲欧洲精品一区二区三区不卡 | 伊人婷婷久久| 夜夜嗨av一区二区三区网站四季av| 国产免费观看久久黄| 亚洲福利视频网| 国产一区二区三区奇米久涩| 亚洲国产裸拍裸体视频在线观看乱了中文 | 国产精品视频xxx| 亚洲高清不卡在线| 国产精品综合色区在线观看| 欧美国产一区二区在线观看| 欧美午夜精品久久久久久久| 久久综合伊人77777蜜臀| 国产精品成人一区二区三区夜夜夜 | 亚洲精品在线观看免费| 国产欧美精品一区二区三区介绍| 亚洲电影欧美电影有声小说| 国产一区久久| 久久久免费精品| 亚洲最快最全在线视频| 亚洲尤物在线视频观看| 亚洲欧洲在线免费| 欧美亚洲综合另类| 亚洲视频中文| 欧美激情久久久久| 亚洲国产高清视频| 亚洲激情偷拍| 噜噜噜噜噜久久久久久91| 欧美在线播放视频| 国产精品久久波多野结衣| 91久久精品国产91性色| 国产主播一区二区三区| 午夜精品久久久久久久蜜桃app| 亚洲少妇最新在线视频| 麻豆免费精品视频| 免费在线观看日韩欧美| 伊人久久亚洲热| 久久夜色精品| 欧美激情bt| 亚洲精品系列| 欧美激情精品久久久| 最新中文字幕亚洲| 亚洲人成人99网站| 欧美xxxx在线观看| 亚洲精品久久久久久久久久久久久| 亚洲国产专区校园欧美| 欧美xart系列高清| 日韩视频专区| 午夜宅男欧美| 国产性天天综合网| 久久先锋影音av| 亚洲国产三级| 亚洲欧美日韩国产中文在线| 国产精品看片资源| 久久精品综合| 亚洲欧洲一区二区在线播放| 一本色道久久99精品综合| 欧美视频在线观看| 午夜欧美电影在线观看| 久久综合影音| 日韩一级在线观看| 国产精品中文在线| 久久成人免费日本黄色| 国产精品99久久久久久有的能看| 亚洲精品综合在线| 欧美视频一区二区三区| 亚洲男人的天堂在线aⅴ视频| 久久野战av| 亚洲精品一品区二品区三品区| 欧美美女bb生活片| 亚洲影视中文字幕| 欧美14一18处毛片| 亚洲欧美日韩视频二区| 在线成人激情视频| 欧美日韩国产影院| 久久精品国产999大香线蕉| 亚洲人体一区| 久久阴道视频| 一本色道久久综合亚洲精品按摩| 国产欧美一区二区精品仙草咪| 每日更新成人在线视频| 在线亚洲精品| 亚洲国产视频一区二区| 久久精品国产综合| 一区二区久久久久久| 1769国产精品| 国产日韩久久| 欧美日韩一区二区三区在线| 久久国产精品99国产| 久久只有精品| 亚洲美女尤物影院| 久久久最新网址| 国产精品99久久不卡二区| 在线观看亚洲视频啊啊啊啊| 欧美香蕉视频| 欧美精品18+| 蜜桃久久av| 久久精品亚洲一区二区| 亚洲在线成人精品| 一区二区三区日韩欧美| 亚洲人成人一区二区在线观看 |