





{"id":1452,"date":"2010-10-06T03:07:58","date_gmt":"2010-10-06T07:07:58","guid":{"rendered":"http:\/\/www.killtest.hk\/?p=1452"},"modified":"2010-10-06T03:07:58","modified_gmt":"2010-10-06T07:07:58","slug":"mfc%e5%92%8cwin32","status":"publish","type":"post","link":"https:\/\/www.killtest.hk\/index.php\/killtest\/mfc%e5%92%8cwin32\/","title":{"rendered":"MFC\u548cWin32\u7684\u6bd4\u8f03"},"content":{"rendered":"<p>1\u3001\u5f9e\u6578\u64da\u7d50\u69cb\u4e0a\u6bd4\u8f03<\/p>\n<p>\u3000\u3000MFC Object\u662f\u76f8\u61c9C++\u985e\u7684\u5be6\u4f8b\uff0c\u9019\u4e9b\u985e\u662fMFC\u6216\u8005\u7a0b\u5e8f\u54e1\u5b9a\u7fa9\u7684\uff1b<\/p>\n<p>\u3000\u3000Windows Object\u662fWindows\u7cfb\u7d71\u7684\u5167\u90e8\u7d50\u69cb\uff0c\u901a\u904e\u58f9\u500b\u53e5\u67c4\u4f86\u5f15\u7528\uff1b<\/p>\n<p>\u3000\u3000MFC\u7d66\u9019\u4e9b\u985e\u5b9a\u7fa9\u4e86\u58f9\u500b\u6210\u54e1\u8b8a\u91cf\u4f86\u4fdd\u5b58MFC Object\u5c0d\u61c9\u7684Windows Object\u7684\u53e5\u67c4\u3002\u5c0d\u65bc\u8a2d\u5099\u63cf\u8ff0\u8868CDC\u985e\uff0c\u5c07\u4fdd\u5b58\u5169\u500bHDC\u53e5\u67c4\u3002<\/p>\n<p>\u3000\u30002\u3001\u5f9e\u5c64\u6b21\u4e0a\u8b1b\u6bd4\u8f03<\/p>\n<p>\u3000\u3000MFC Object\u662f\u9ad8\u5c64\u7684\uff0cWindows Object\u662f\u4f4e\u5c64\u7684\uff1b<\/p>\n<p>\u3000\u3000MFC Object\u5c01\u88dd\u4e86Windows Object\u7684\u5927\u90e8\u5206\u6216\u5168\u90e8\u529f\u80fd\uff0cMFC Object\u7684\u4f7f\u7528\u8005\u4e0d\u9700\u8981\u76f4\u63a5\u61c9\u7528Windows Object\u7684HANDLE\uff08\u53e5\u67c4\uff09\u4f7f\u7528Win32 API\uff0c\u4ee3\u66ff\u5b83\u7684\u662f\u5f15\u7528\u76f8\u61c9\u7684MFC Object\u7684\u6210\u54e1\u51fd\u6578\u3002<\/p>\n<p>\u3000\u30003\u3001\u5f9e\u5275\u5efa\u4e0a\u6bd4\u8f03<\/p>\n<p>\u3000\u3000MFC Object\u901a\u904e\u69cb\u9020\u51fd\u6578\u7531\u7a0b\u5e8f\u76f4\u63a5\u5275\u5efa\uff1bWindows Object\u7531\u76f8\u61c9\u7684SDK\u51fd\u6578\u5275\u5efa\u3002<\/p>\n<p>\u3000\u3000MFC\u4e2d\uff0c\u4f7f\u7528\u9019\u4e9bMFC Object\uff0c\u58f9\u822c\u5206\u5169\u6b65\uff1a<\/p>\n<p>\u3000\u3000\u9996\u5148\uff0c\u5275\u5efa\u58f9\u500bMFC Object\uff0c\u6216\u8005\u5728STACK\u4e2d\u5275\u5efa\uff0c\u6216\u8005\u5728HEAP\u4e2d\u5275\u5efa\uff0c\u9019\u6642\uff0cMFC Object\u7684\u53e5\u67c4\u5be6\u4f8b\u8b8a\u91cf\u70ba\u7a7a\uff0c\u6216\u8005\u8aaa\u4e0d\u662f\u58f9\u500b\u6709\u6548\u7684\u53e5\u67c4\u3002<\/p>\n<p>\u3000\u3000\u7136\u5f8c\uff0c\u8abf\u7528MFC Object\u7684\u6210\u54e1\u51fd\u6578\u5275\u5efa\u76f8\u61c9\u7684Windows Object\uff0cMFC\u7684\u53e5\u67c4\u8b8a\u91cf\u5b58\u5132\u58f9\u500b\u6709\u6548\u53e5\u67c4\u3002<\/p>\n<p>\u3000\u30004\u3001\u5f9e\u8f49\u63db\u4e0a\u6bd4\u8f03<\/p>\n<p>\u3000\u3000\u53ef\u4ee5\u5f9e\u58f9\u500bMFC Object\u5f97\u5230\u5c0d\u61c9\u7684Windows Object\u7684\u53e5\u67c4\uff1b\u58f9\u822c\u4f7f\u7528MFC Object\u7684\u6210\u54e1\u51fd\u6578GetSafeHandle\u5f97\u5230\u5c0d\u61c9\u7684\u53e5\u67c4\u3002<\/p>\n<p>\u3000\u3000\u53ef\u4ee5\u5f9e\u58f9\u500b\u5df2\u5b58\u5728\u7684Windows Object\u5275\u5efa\u58f9\u500b\u5c0d\u61c9\u7684MFC Object\uff1b \u58f9\u822c\u4f7f\u7528MFC Object\u7684\u6210\u54e1\u51fd\u6578Attach\u6216\u8005FromHandle\u4f86\u5275\u5efa\uff0c\u524d\u8005\u5f97\u5230\u58f9\u500b\u6c38\u4e45\u6027\u5c0d\u8c61\uff0c\u5f8c\u8005\u5f97\u5230\u7684\u53ef\u80fd\u662f\u58f9\u500b\u81e8\u6642\u5c0d\u8c61\u3002<\/p>\n<p>\u3000\u30005\u3001\u5f9e\u4f7f\u7528\u7bc4\u570d\u4e0a\u6bd4\u8f03<\/p>\n<p>\u3000\u3000MFC Object\u5c0d\u7cfb\u7d71\u7684\u5176\u4ed6\u9032\u7a0b\u4f86\u8aaa\u662f\u4e0d\u53ef\u898b\u3001\u4e0d\u53ef\u7528\u7684\uff1b\u800cWindows Object\u58f9\u65e6\u5275\u5efa\uff0c\u5176\u53e5\u67c4\u662f\u6574\u500bWindows\u7cfb\u7d71\u5168\u5c40\u7684\u3002\u58f9\u4e9b\u53e5\u67c4\u53ef\u4ee5\u88ab\u5176\u4ed6\u9032\u7a0b\u4f7f\u7528\u3002\u5178\u578b\u5730\uff0c\u58f9\u500b\u9032\u7a0b\u53ef\u4ee5\u7372\u5f97\u53e6\u58f9\u9032\u7a0b\u7684\u7a97\u53e3\u53e5\u67c4\uff0c\u4e26\u7d66\u8a72\u7a97\u53e3\u767c\u9001\u6d88\u606f\u3002<\/p>\n<p>\u3000\u3000\u5c0d\u540c\u58f9\u500b\u9032\u7a0b\u7684\u7dda\u7a0b\u4f86\u8aaa\uff0c\u53ea\u53ef\u4ee5\u4f7f\u7528\u672c\u7dda\u7a0b\u5275\u5efa\u7684MFC Object\uff0c\u4e0d\u80fd\u4f7f\u7528\u5176\u4ed6\u7dda\u7a0b\u7684MFC Object\u3002<\/p>\n<p>\u3000\u30006\u3001\u5f9e\u92b7\u6bc0\u4e0a\u6bd4\u8f03<\/p>\n<p>\u3000\u3000MFC Object\u96a8\u8457\u6790\u69cb\u51fd\u6578\u7684\u8abf\u7528\u800c\u6d88\u5931\uff1b\u4f46Windows Object\u5fc5\u9808\u7531\u76f8\u61c9\u7684Windows\u7cfb\u7d71\u51fd\u6578\u92b7\u6bc0\u3002<\/p>\n<p>\u3000\u3000\u8a2d\u5099\u63cf\u8ff0\u8868CDC\u985e\u7684\u5c0d\u8c61\u6709\u6240\u4e0d\u540c\uff0c\u5b83\u5c0d\u61c9\u7684HDC\u53e5\u67c4\u5c0d\u8c61\u53ef\u80fd\u4e0d\u662f\u88ab\u92b7\u6bc0\uff0c\u800c\u662f\u88ab\u91cb\u653e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5f9e\u6578\u64da\u7d50\u69cb\u4e0a\u6bd4\u8f03 \u3000\u3000MFC Object\u662f\u76f8\u61c9C++\u985e\u7684\u5be6\u4f8b\uff0c\u9019\u4e9b\u985e\u662fMFC\u6216\u8005\u7a0b\u5e8f\u54e1\u5b9a\u7fa9\u7684\uff1b \u3000\u3000Wi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[536,537],"class_list":["post-1452","post","type-post","status-publish","format-standard","hentry","category-killtest","tag-mfc","tag-win32"],"_links":{"self":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/comments?post=1452"}],"version-history":[{"count":0,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/posts\/1452\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/media?parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/categories?post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.killtest.hk\/index.php\/wp-json\/wp\/v2\/tags?post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}