{"id":659495,"date":"2011-05-02T12:02:10","date_gmt":"2011-05-02T12:02:10","guid":{"rendered":"http:\/\/sunblog.72pines.com\/?p=659393"},"modified":"2011-05-02T12:02:10","modified_gmt":"2011-05-02T12:02:10","slug":"kb2465361-bigger","status":"publish","type":"post","link":"https:\/\/www.sunjw.us\/blog\/kb2465361-bigger\/","title":{"rendered":"KB2465361 \u8865\u4e01\u5bfc\u81f4 VS08 \u7f16\u8bd1 MFC \u4f53\u79ef\u589e\u5927"},"content":{"rendered":"<p>\u5fae\u8f6f\u7684 KB2465361 \u8865\u4e01\u5bfc\u81f4 VS08 \u7f16\u8bd1\u51fa\u6765\u7684 MFC \u4f53\u79ef\u660e\u663e\u7684\u589e\u5927\u3002\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\u662f\u5728\u7f16\u8bd1 fHash \u7684\u65f6\u5019\uff0c\u539f\u6765\u53ea\u6709 297KB \u7684 Release Build \u4e00\u4e0b\u5b50\u53d8\u6210\u4e86 2MB \u591a\uff0c\u4e00\u5f00\u59cb\u8fd8\u4ee5\u4e3a\u662f\u6211\u81ea\u5df1\u4fee\u6539\u4e86\u4ee3\u7801\u6240\u81f4\uff0c\u4f46\u662f\u4ed4\u7ec6\u67e5\u770b\u53d8\u5927\u524d\u540e\u7684\u4ee3\u7801\uff0c\u6ca1\u6709\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4f53\u79ef\u660e\u663e\u53d8\u5316\u7684\u4fee\u6539\u3002\u7528 Dependency Walker \u67e5\u770b\u540e\u53d1\u73b0\uff0c\u65b0\u7684\u4e8c\u8fdb\u5236\u94fe\u63a5\u4e86 gdiplus.dll \u7b49\u4e00\u5806\u65b0\u7684\u94fe\u63a5\u5e93\uff0c\u800c\u4ee3\u7801\u4e2d\u6839\u672c\u5c31\u6ca1\u6709\u7528\u5230\u5b83\u4eec\u3002<\/p>\n<p>\u4ed4\u7ec6\u60f3\u60f3\u548c\u4e0a\u4e00\u6b21\u7f16\u8bd1\u4e4b\u95f4\u552f\u4e00\u7684\u53d8\u5316\u5c31\u662f\u5b89\u88c5\u4e86 <a href=\"http:\/\/www.microsoft.com\/downloads\/details.aspx?familyid=4149f21c-37f7-4516-83e1-d70c738d612b\" target=\"_blank\">KB2465361<\/a> \u8865\u4e01\u3002\u4e0a\u7f51\u67e5\u4e86\u4e00\u4e0b\uff0c\u6709<a href=\"http:\/\/tedwvc.wordpress.com\/2011\/04\/16\/static-mfc-code-bloat-problem-from-vc2010-is-now-in-vc2008-sp1security-fix\/\" target=\"_blank\">\u8fd9\u4e00\u7bc7\u535a\u5ba2<\/a>\u786e\u8ba4\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u5e76\u63d0\u51fa\u4e86\u89e3\u51b3\u65b9\u6cd5\u3002<!--more--><\/p>\n<p>1) open up your stdafx.cpp from your project<br \/>\n2) paste the following code after the <code>#include \"stdafx.h\"<\/code><\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n\/\/ this is our own local copy of the AfxLoadSystemLibraryUsingFullPath function\nHMODULE AfxLoadSystemLibraryUsingFullPath(const WCHAR *pszLibrary)\n{\nWCHAR wszLoadPath&#x5B;MAX_PATH+1];\nif (::GetSystemDirectoryW(wszLoadPath, _countof(wszLoadPath)) == 0)\n{\nreturn NULL;\n}\n\nif (wszLoadPath&#x5B;wcslen(wszLoadPath)-1] != L&#039;\\&#039;)\n{\nif (wcscat_s(wszLoadPath, _countof(wszLoadPath), L&quot;\\&quot;) != 0)\n{\nreturn NULL;\n}\n}\n\nif (wcscat_s(wszLoadPath, _countof(wszLoadPath), pszLibrary) != 0)\n{\nreturn NULL;\n}\n\nreturn(::AfxCtxLoadLibraryW(wszLoadPath));\n}\n<\/pre>\n<p>3) Rebuild your app, and voila, it\u2019s all better now.<\/p>\n<p>\u7167\u505a\u4e4b\u540e\uff0c\u91cd\u65b0\u7f16\u8bd1\uff0c\u4f53\u79ef\u53c8\u56de\u5230\u4e86\u6b63\u5e38\u7684 297KB\uff0cgdiplus.dll \u4e4b\u7c7b\u7684\u591a\u4f59\u5e93\u4e5f\u4e0d\u518d\u88ab\u94fe\u63a5\u8fdb\u6765\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5fae\u8f6f\u7684 KB2465361 \u8865\u4e01\u5bfc\u81f4 VS08 \u7f16\u8bd1\u51fa\u6765\u7684 MFC \u4f53\u79ef\u660e\u663e\u7684\u589e\u5927\u3002\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\u662f\u5728\u7f16\u8bd1 fH [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13],"tags":[370,130,140,141,219,268,310],"class_list":["post-659495","post","type-post","status-publish","format-standard","hentry","category-7","category-13","tag-fhash","tag-kb2465361","tag-mfc","tag-microsoft","tag-vs","tag-268","tag-310"],"_links":{"self":[{"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/posts\/659495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/comments?post=659495"}],"version-history":[{"count":0,"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/posts\/659495\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/media?parent=659495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/categories?post=659495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sunjw.us\/blog\/wp-json\/wp\/v2\/tags?post=659495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}