{"id":18959,"date":"2025-02-26T12:34:51","date_gmt":"2025-02-26T04:34:51","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=18959"},"modified":"2025-03-11T19:48:54","modified_gmt":"2025-03-11T11:48:54","slug":"mfc-%e7%ac%ac-2-%e7%af%87%ef%bc%9a%e5%af%b9%e8%af%9d%e6%a1%86%ef%bc%88%e7%bc%96%e8%be%91%e4%b8%ad%ef%bc%89","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=18959","title":{"rendered":"MFC\uff1adialog \u5bf9\u8bdd\u6846"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=18959\/#%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83\" >\u6d4b\u8bd5\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=18959\/#%E5%AF%B9%E8%AF%9D%E6%A1%86\" >\u5bf9\u8bdd\u6846<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.iyatt.com\/?p=18959\/#%E6%A8%A1%E6%80%81%E5%AF%B9%E8%AF%9D%E6%A1%86%E7%A4%BA%E4%BE%8B\" >\u6a21\u6001\u5bf9\u8bdd\u6846\u793a\u4f8b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/blog.iyatt.com\/?p=18959\/#%E9%9D%9E%E6%A8%A1%E6%80%81%E5%AF%B9%E8%AF%9D%E6%A1%86%E7%A4%BA%E4%BE%8B\" >\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u793a\u4f8b<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E6%B5%8B%E8%AF%95%E7%8E%AF%E5%A2%83\"><\/span>\u6d4b\u8bd5\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<ul>\n<li>Windows 11 \u4e13\u4e1a\u7248<\/li>\n<li>Visual Studio 2022\uff08ISO C++14\uff09<\/li>\n<li>\u8be6\u7ec6\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=18843#%E7%8E%AF%E5%A2%83\">https:\/\/blog.iyatt.com\/?p=18843#%E7%8E%AF%E5%A2%83<\/a><\/li>\n<\/ul>\n<h1><span class=\"ez-toc-section\" id=\"%E5%AF%B9%E8%AF%9D%E6%A1%86\"><\/span>\u5bf9\u8bdd\u6846<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<table>\n<thead>\n<tr>\n<th>\u7279\u6027<\/th>\n<th>\u6a21\u6001\u5bf9\u8bdd\u6846\uff08Modal\uff09<\/th>\n<th>\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\uff08Modeless\uff09<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u963b\u585e\u6027<\/strong><\/td>\n<td>\u963b\u585e\u4e3b\u754c\u9762\u64cd\u4f5c\uff0c\u5fc5\u987b\u5148\u5904\u7406\u5bf9\u8bdd\u6846<\/td>\n<td>\u975e\u963b\u585e\uff0c\u7528\u6237\u53ef\u4ee5\u540c\u65f6\u64cd\u4f5c\u4e3b\u754c\u9762\u548c\u5176\u4ed6\u7a97\u53e3<\/td>\n<\/tr>\n<tr>\n<td><strong>\u7126\u70b9<\/strong><\/td>\n<td>\u5f3a\u5236\u7528\u6237\u96c6\u4e2d\u6ce8\u610f\u529b\u5904\u7406\u5bf9\u8bdd\u6846\u5185\u5bb9<\/td>\n<td>\u7528\u6237\u53ef\u4ee5\u81ea\u7531\u5207\u6362\u7126\u70b9\uff0c\u7075\u6d3b\u6027\u9ad8<\/td>\n<\/tr>\n<tr>\n<td><strong>\u4f7f\u7528\u573a\u666f<\/strong><\/td>\n<td>\u7b80\u5355\u7684\u4ea4\u4e92\uff0c\u5982\u786e\u8ba4\u64cd\u4f5c\u3001\u8f93\u5165\u5fc5\u8981\u4fe1\u606f<\/td>\n<td>\u590d\u6742\u7684\u4ea4\u4e92\uff0c\u5982\u5de5\u5177\u7a97\u53e3\u3001\u6301\u7eed\u53ef\u7528\u7684\u529f\u80fd<\/td>\n<\/tr>\n<tr>\n<td><strong>\u793a\u4f8b<\/strong><\/td>\n<td>\u5220\u9664\u786e\u8ba4\u6846\u3001\u767b\u5f55\u6846\u3001\u9519\u8bef\u63d0\u793a\u6846<\/td>\n<td>\u67e5\u627e\u548c\u66ff\u6362\u7a97\u53e3\u3001\u5c5e\u6027\u9762\u677f\u3001\u5e2e\u52a9\u7a97\u53e3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><span class=\"ez-toc-section\" id=\"%E6%A8%A1%E6%80%81%E5%AF%B9%E8%AF%9D%E6%A1%86%E7%A4%BA%E4%BE%8B\"><\/span>\u6a21\u6001\u5bf9\u8bdd\u6846\u793a\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u65b0\u5efa\u4e00\u4e2a <strong>MFC\u5e94\u7528<\/strong><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740573957547.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1005px; --smush-placeholder-aspect-ratio: 1005\/671;\" \/><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740573993926.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1011px; --smush-placeholder-aspect-ratio: 1011\/676;\" \/><\/p>\n<p>\u5e94\u7528\u7a0b\u5e8f\u7c7b\u578b\uff1a\u57fa\u4e8e\u5bf9\u8bdd\u6846<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740574025688.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1014px; --smush-placeholder-aspect-ratio: 1014\/673;\" \/><\/p>\n<p>\u5728<strong>\u8d44\u6e90\u89c6\u56fe<\/strong>\u5c55\u5f00\u9879\u76ee\uff0c\u5728\u5f53\u524d\u9879\u76ee\u8d44\u6e90\u7684 Dialog \u4e0b\u53ef\u4ee5\u770b\u5230\u4e24\u4e2a\uff0c\u4e0a\u9762\u4e00\u4e2a\u662f\u521b\u5efa\u7684<strong>\u5173\u4e8e<\/strong>\u7a97\u53e3\uff0c\u4e0b\u9762\u90a3\u4e2a\u5c31\u662f\u53f3\u4fa7\u6b63\u5728\u9884\u89c8\u7684\u7a97\u53e3<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579295835.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1116px; --smush-placeholder-aspect-ratio: 1116\/827;\" \/><\/p>\n<p>\u5728\u53f3\u4fa7\u9884\u89c8\u7a97\u53e3\u4e2d\u70b9\u51fb\u4e00\u4e0b\uff0c\u628a\u9f20\u6807\u7126\u70b9\u5207\u6362\u5230\u8fd9\u4e2a\u7a97\u53e3\u4e2d\uff0c\u7136\u540e\u6309<code class=\"kb-btn\">Ctrl<\/code>+<code class=\"kb-btn\">A<\/code>\u5168\u9009\uff0c\u7136\u540e\u6309<code class=\"kb-btn\">Del<\/code>\u5220\u9664\u6389\u8fd9\u4e9b\u63a7\u4ef6<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579473991.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1057px; --smush-placeholder-aspect-ratio: 1057\/608;\" \/><\/p>\n<p>\u5728<strong>\u5de5\u5177\u7bb1<\/strong>\u89c6\u56fe\u4e2d\u62d6\u52a8\u4e00\u4e2a<strong>Button<\/strong>\u63a7\u4ef6\u5230\u7a97\u53e3\u4e2d<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579612879.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1710px; --smush-placeholder-aspect-ratio: 1710\/776;\" \/><\/p>\n<p>\u5728\u65b0\u5efa\u7684\u8fd9\u4e2a\u6309\u94ae\u4e0a\u53f3\u952e\u5c5e\u6027\uff0c\u5728\u5c5e\u6027\u7684<strong>\u63cf\u8ff0\u6587\u5b57<\/strong>\u4fee\u6539\uff0c\u6b64\u5904\u7684\u5185\u5bb9\u5c31\u662f\u6309\u94ae\u4e0a\u663e\u793a\u7684\u5185\u5bb9<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579681365.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1094px; --smush-placeholder-aspect-ratio: 1094\/676;\" \/><\/p>\n<p>\u5728<strong>\u8d44\u6e90\u89c6\u56fe<\/strong>\u7684<strong>Dialog<\/strong>\u4e0a\u53f3\u952e<strong>\u63d2\u5165<\/strong><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579763508.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 439px; --smush-placeholder-aspect-ratio: 439\/809;\" \/><\/p>\n<p>\u4f1a\u65b0\u5efa\u4e00\u4e2a\u5bf9\u8bdd\u6846<strong>IDD_DIALOG1<\/strong>\uff0c\u53cc\u8fd8\u662f\u4e00\u6837\u7684\u64cd\u4f5c\uff0c\u5168\u9009\u5220\u9664\u7a97\u53e3\u4e2d\u7684\u9ed8\u8ba4\u63a7\u4ef6\u3002<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740579877227.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1080px; --smush-placeholder-aspect-ratio: 1080\/609;\" \/><\/p>\n<p>\u62d6\u4e00\u4e2a<strong>Static Text<\/strong>\u8fdb\u53bb<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580047192.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1377px; --smush-placeholder-aspect-ratio: 1377\/624;\" \/><\/p>\n<p>\u548c\u4e0a\u9762\u6309\u94ae\u540c\u6837\u7684\u64cd\u4f5c\u65b9\u5f0f\u53ef\u4ee5\u4fee\u6539\u5b83\u663e\u793a\u7684\u5185\u5bb9<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580127935.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1088px; --smush-placeholder-aspect-ratio: 1088\/567;\" \/><\/p>\n<p>\u5728\u8fd9\u4e2a\u7a97\u53e3\u4e0a\u53f3\u952e<strong>\u6dfb\u52a0\u7c7b<\/strong><br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580176617.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 569px; --smush-placeholder-aspect-ratio: 569\/642;\" \/><\/p>\n<p>\u4e3a\u8fd9\u4e2a\u7a97\u53e3\u521b\u5efa\u4e00\u4e2a\u7c7b\uff0c\u81ea\u5df1\u547d\u540d\uff0c\u8fd9\u91cc\u6211\u53d6\u4e3a<strong>ModalDialog<\/strong>\uff08\u5bf9\u4e8e C++ \u6211\u4e00\u822c\u4f7f\u7528 .hpp \u6269\u5c55\u540d\uff0c\u53ef\u4ee5\u7528\u9ed8\u8ba4\u7684 .h\uff0c\u540e\u9762\u5f15\u7528\u8fd9\u4e2a\u5934\u6587\u4ef6\u4fdd\u6301\u4e00\u81f4\u5c31\u884c\uff09<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580252121.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 737px; --smush-placeholder-aspect-ratio: 737\/679;\" \/><\/p>\n<p>\u7136\u540e\u5de6\u4fa7\u53cc\u51fb\u53ef\u4ee5\u5207\u6362\u6253\u5f00\u5f00\u59cb\u521b\u5efa\u7684\u4e3b\u7a97\u53e3<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580364156.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1044px; --smush-placeholder-aspect-ratio: 1044\/590;\" \/><\/p>\n<p>\u5728\u6309\u94ae\u4e0a\u53f3\u952e<strong>\u5c5e\u6027<\/strong>\uff0c\u5728\u6309\u94ae\u5c5e\u6027\u91cc\u70b9\u51fb\u95ea\u7535\u56fe\u6807<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580588458.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1021px; --smush-placeholder-aspect-ratio: 1021\/395;\" \/><\/p>\n<p>\u5728<strong>BN_CLICKED<\/strong>\uff08\u70b9\u51fb\u4e8b\u4ef6\uff09\u540e\u5c55\u5f00\u70b9<strong>Add<\/strong>\u6dfb\u52a0\u4e8b\u4ef6\u56de\u8c03\u65b9\u6cd5<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580683388.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 406px; --smush-placeholder-aspect-ratio: 406\/290;\" \/><\/p>\n<p>\u5c31\u81ea\u52a8\u521b\u5efa\u4e86<strong>CmodalDialogProjectDlg::OnBnClickedButton1<\/strong>\u65b9\u6cd5<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580781477.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1077px; --smush-placeholder-aspect-ratio: 1077\/579;\" \/><\/p>\n<p>\u5728\u8fd9\u4e2a\u6e90\u6587\u4ef6\u91cc\u9762\u6dfb\u52a0\u5f15\u7528\u4e0a\u9762\u521b\u5efa\u7684 <strong>ModalDialog<\/strong> \u5934\u6587\u4ef6<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740580923424.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 485px; --smush-placeholder-aspect-ratio: 485\/287;\" \/><\/p>\n<p>\u56de\u5230\u521a\u624d\u521b\u5efa\u7684\u65b9\u6cd5\u90a3\u91cc\uff0c\u5728\u91cc\u9762\u5199\u5165\u4ee3\u7801\uff0c\u5b9e\u73b0\u5f39\u51fa\u521b\u5efa\u7684\u6a21\u6001\u5bf9\u8bdd\u6846<\/p>\n<pre><code class=\"language-cpp\">    ModalDialog dlg;\n    dlg.DoModal();<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740581053804.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 893px; --smush-placeholder-aspect-ratio: 893\/448;\" \/><\/p>\n<p>\u6309<code class=\"kb-btn\">F5<\/code>\u8c03\u8bd5\u8fd0\u884c<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740581097814.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 567px; --smush-placeholder-aspect-ratio: 567\/389;\" \/><\/p>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740581112813.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 575px; --smush-placeholder-aspect-ratio: 575\/562;\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E9%9D%9E%E6%A8%A1%E6%80%81%E5%AF%B9%E8%AF%9D%E6%A1%86%E7%A4%BA%E4%BE%8B\"><\/span>\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u793a\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u7ee7\u7eed\u5728\u4e0a\u9762\u7684\u9879\u76ee\u4e2d\u4fee\u6539\uff0c\u540c\u6837\u7684\u65b9\u5f0f\u518d\u6dfb\u52a0\u4e00\u4e2a\u5bf9\u8bdd\u6846\u7a97\u53e3 <strong>IDD_DIALOG2<\/strong>\uff0c\u5e76\u4e3a\u5176\u521b\u5efa\u7c7b <strong>ModelessDialog<\/strong>\uff08\u81ea\u5df1\u547d\u540d\uff09<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740665463016.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1037px; --smush-placeholder-aspect-ratio: 1037\/524;\" \/><\/p>\n<p>\u5728\u4e3b\u7a97\u53e3\u4e2d\u518d\u6dfb\u52a0\u4e00\u4e2a\u6309\u94ae<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740665567704.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 971px; --smush-placeholder-aspect-ratio: 971\/531;\" \/><\/p>\n<p>\u4e3a\u8fd9\u4e2a\u6309\u94ae\u6dfb\u52a0\u70b9\u51fb\u4e8b\u4ef6\u56de\u8c03\u65b9\u6cd5<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740665635179.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1035px; --smush-placeholder-aspect-ratio: 1035\/385;\" \/><\/p>\n<p>\u518d\u7c7b\u58f0\u660e\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u6210\u5458\u5c5e\u6027\uff0c\u7528\u4e8e\u5b58\u50a8\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\uff0c\u53e6\u5916\u6dfb\u52a0\u4e00\u4e2a\u6790\u6784\u51fd\u6570\u7528\u4e8e\u91ca\u653e<\/p>\n<pre><code class=\"language-cpp\">private:\n    CDialogEx* pModelessDialog = nullptr;\n\npublic:\n    ~CmodalDialogProjectDlg();<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740666322272.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 948px; --smush-placeholder-aspect-ratio: 948\/616;\" \/><\/p>\n<p>\u7136\u540e\u56de\u5230\u56de\u8c03\u65b9\u6cd5\u5904\uff0c\u6ce8\u610f\u5f15\u7528\u521b\u5efa\u7684\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u7684\u5934\u6587\u4ef6\uff0c\u518d\u5199\u5165<\/p>\n<pre><code class=\"language-cpp\">    if (this-&gt;pModelessDialog == nullptr)\n    {\n        this-&gt;pModelessDialog = new ModelessDialog(this);\n        this-&gt;pModelessDialog-&gt;Create(IDD_DIALOG2);\n    }\n    this-&gt;pModelessDialog-&gt;ShowWindow(SW_SHOW);<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740665785114.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1014px; --smush-placeholder-aspect-ratio: 1014\/495;\" \/><\/p>\n<p>\u7136\u540e\u6dfb\u52a0\u6790\u6784\u51fd\u6570\u7684\u5b9a\u4e49<\/p>\n<pre><code class=\"language-cpp\">CmodalDialogProjectDlg::~CmodalDialogProjectDlg()\n{\n    \/\/ \u68c0\u67e5\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u6307\u9488\u662f\u5426\u5df2\u5206\u914d\n    if (this-&gt;pModelessDialog != nullptr)\n    {\n        \/\/ \u5982\u679c\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u5df2\u7ecf\u521b\u5efa\u4e14\u672a\u9500\u6bc1\uff0c\u5219\u5148\u9500\u6bc1\u5b83\n        if (::IsWindow(this-&gt;pModelessDialog-&gt;m_hWnd))\n        {\n            this-&gt;pModelessDialog-&gt;DestroyWindow();\n        }\n\n        \/\/ \u91ca\u653e\u5185\u5b58\n        delete this-&gt;pModelessDialog;\n        this-&gt;pModelessDialog = nullptr;\n    }\n}<\/code><\/pre>\n<p><img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740666417340.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 892px; --smush-placeholder-aspect-ratio: 892\/744;\" \/><\/p>\n<p><strong>CDialogEx<\/strong> \u662f\u521b\u5efa\u7684\u81ea\u5b9a\u4e49\u5bf9\u8bdd\u6846\u7684\u7236\u7c7b\uff0c\u5728\u7c7b\u58f0\u660e\u4e2d\u5c31\u58f0\u660e\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u5728\u89e6\u53d1\u6253\u5f00\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\u7684\u5730\u65b9\uff0c\u5148\u68c0\u67e5\u662f\u5426\u8fd8\u672a\u521b\u5efa\uff0c\u5728\u9700\u8981\u7528\u7684\u65f6\u5019\u624d\u521b\u5efa\u4e00\u4e2a\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\uff0c\u7136\u540e\u663e\u793a\u5c31\u884c\u3002\u4e0b\u4e00\u6b21\u9700\u8981\u4f7f\u7528\u4e5f\u53ef\u4ee5\u4e0d\u7528\u521b\u5efa\u4e86\uff0c\u76f4\u63a5\u6253\u5f00\u663e\u793a\u5c31\u884c\u3002<\/p>\n<p>\u5148\u70b9\u51fa\u975e\u6a21\u6001\u5bf9\u8bdd\u6846\uff0c\u4e3b\u7a97\u53e3\u662f\u4e0d\u88ab\u963b\u585e\u7684\uff0c\u53ef\u4ee5\u7ee7\u7eed\u64cd\u4f5c\u70b9\u51fa\u6a21\u6001\u5bf9\u8bdd\u6846\uff0c\u6b64\u65f6\u4e3b\u7a97\u53e3\u5c31\u4f1a\u88ab\u6a21\u6001\u5bf9\u8bdd\u6846\u963b\u585e\u4e86<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/02\/image-1740666456067.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1039px; --smush-placeholder-aspect-ratio: 1039\/601;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6d4b\u8bd5\u73af\u5883 Windows 11 \u4e13\u4e1a\u7248 Visual Studio 2022\uff08ISO C++14\uff09 \u8be6\u7ec6\uff1aht [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,589,640,611],"tags":[],"class_list":["post-18959","post","type-post","status-publish","format-standard","hentry","category-all","category-c-c","category-mfc","category-windows"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/18959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18959"}],"version-history":[{"count":13,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/18959\/revisions"}],"predecessor-version":[{"id":19562,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/18959\/revisions\/19562"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}