{"id":1253,"date":"2013-08-20T14:26:00","date_gmt":"2013-08-20T14:26:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2013\/08\/20\/atl-and-mfc-changes-and-fixes-in-visual-studio-2013\/"},"modified":"2019-02-18T18:40:56","modified_gmt":"2019-02-18T18:40:56","slug":"atl-and-mfc-changes-and-fixes-in-visual-studio-2013","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/atl-and-mfc-changes-and-fixes-in-visual-studio-2013\/","title":{"rendered":"ATL and MFC changes and fixes in Visual Studio 2013"},"content":{"rendered":"<p>Hello, I&rsquo;m <strong>Pat Brenner<\/strong>, a developer on the Visual C++ Libraries team.&nbsp; In this&nbsp;blog post I would like to share with you the changes that we&rsquo;ve made in ATL and MFC for Visual Studio 2013.<\/p>\n<p>One of the major changes we made was to eliminate the ATL DLL altogether.&nbsp; All ATL code is now static, either in the header files or in the ATL static library.&nbsp; We also reduced the amount of code in the ATL static library substantially, so there are no longer multiple static libraries for debug\/release mode or Unicode\/ANSI character set.&nbsp; There is only one ATL static library that is common to all configurations.&nbsp;<\/p>\n<p>The changes to ATL also included the elimination of the ATL\/MFC Trace Tool and the simplification of the tracing mechanism.&nbsp; The TRACE macros now essentially boil down to OutputDebugString, and there is no external controller of tracing level (like the trace tool provided)&mdash;the tracing level is set in the application itself.&nbsp; This does cause source-breaking changes in some uses of the ATL::CTraceCategory class, which will require changes in source code when migrating to Visual Studio 2013.<\/p>\n<p>The major change we made in MFC was the deprecation of MBCS support (see more information in <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2013\/07\/08\/mfc-support-for-mbcs-deprecated-in-visual-studio-2013.aspx\">this separate blog post<\/a>).<\/p>\n<p>In addition, we fixed about 105 bugs in MFC and about 60 bugs in ATL.&nbsp; About one-fourth of these bugs (in both libraries) were reported by customers.<\/p>\n<p>Though I cannot provide a complete list of the bugs in our internal bug database, here is a list of the bugs that were reported by customers through our Connect site that have been fixed in ATL and MFC for Visual Studio 2013 RTM. Click on any Connect bug number to see more information about that bug.&nbsp; Note that most of these bugs were fixed for the Preview release as well.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><strong>Connect #<\/strong><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p align=\"center\"><strong>Bug Title<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/710163\">710163<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>atlbase.h disables no longer existing C4217 warning<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/714790\">714790<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Useless line of code in AtlSafeRealloc()<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/714791\">714791<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>AtlSafeRealloc() treats failures inconsistently and this leads&nbsp;to memory leaks<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/714840\">714840<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CAtlServiceModuleT::LogEventEx() contains a useless check<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/714802\">714802<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Suspicious error handling code in CAtlExeModuleT::StartMonitor()<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/742895\">742895<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CComApartment::Apartment() leaks objects on edge cases<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/736213\">736213<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>ATL::CComSafeArray::operator[] ambiguity<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/764800\">764800<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>wrong\/missing sal annotations on consumer oledb macros<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/750369\">750369<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Breaking change in how the ATL OLE DB CCommand::Execute method&nbsp;behaves<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/774871\">774871<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Certification fails for Windows Store App with ATL-based library<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/785936\">785396<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Uninstalling VS2012 Update 2 and repair of VS results in ATL&nbsp;files missing.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/789669\">789669<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>ATL CRBMap::Lookup code analysis markup issue<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/790309\">790309<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>VC++11 regression: error C2338: db_command using v110 toolset<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/745790\">745790<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Static MFC executables produced by Visual Studio 2012 RC are&nbsp;huge<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/750838\">750838<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>MFC loads DLLs using LoadLibraryEx with flag only supported on&nbsp;Windows8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/757588\">757588<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CMFCRibbonBar::AddToTabs removes a wrong button from the&nbsp;m_arButtons array<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/763947\">763947<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>EndDialog in OnInitDialog reopen Dialog<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/763517\">763517<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>IMPLEMENT_DYNAMIC produces compile error for statically linked&nbsp;MFC projects<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/768378\">768378<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CMFCTabCtrl bug<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/769093\">769093<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>MFC Edit Browse box not showing browse button.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/772859\">772859<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Calling EndDialog() within OnInitDialog() causes the dialog to&nbsp;be displayed twice.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/750859\">750859<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Visual Studio 11 Beta &#8211; bug running .exe in XP service pack 3<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/763474\">763474<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Errors detected in the Visual C++ 2012 libraries<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/760371\">760371<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>LocalFree called twice in CDatabase (MFC 11)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/710858\">710858<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>MFC OLE-Server doesn&#8217;t seem to support the new style MFC&nbsp; Toolbars<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/773463\">773463<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Attempting to use DrawStatusText after including afxwin.h&nbsp; results in link error<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/768257\">768257<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Probems with CRecordset::GetFieldValue(short nIndex,&nbsp; CDBVariant&amp; varValue) in VS2012<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/772549\">772549<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>x64 MFC Macro Bug &#8211; ON_WM_POWERBROADCAST() \/&nbsp;&nbsp; CWnd::OnPowerBroadcast<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/773488\">773448<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CHttpFile::QueryInfo() returns &#8220;corrupted&#8221; CStrings&nbsp;with invalid lengths.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/778201\">778201<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Missing MFC Functions<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/77604\">777604<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CWnd::GetScrollLimit returns 1 if scrolling is deactivated<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/781179\">781179<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CMFCPopupMenu crash when you click outside while submenu still&nbsp;open<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/781379\">781379<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CMFCShellTreeCtrl fails to handle some UNC pathnames correctly<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/781257\">781257<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>MFC &#8211; CMFCTabCtrl &#8211; when style is STYLE_3D_VS2005 and&nbsp;SetActiveTabBoldFont() is set<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/789970\">789970<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>Unpaired pragma warning push\/pop in afxwin.h in Release build<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/790246\">790246<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>MFC: bad hard typecast in CMFCToolBarMenuButton::CompareWith<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/790975\">790975<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>HTTP_QUERY_FLAG_REQUEST_HEADERS on CHttpFile::QueryInfo()&nbsp;&nbsp; asserts wrongly<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" nowrap width=\"79\">\n<p align=\"center\"><a href=\"http:\/\/connect.microsoft.com\/VisualStudio\/feedback\/details\/792003\">792003<\/a><\/p>\n<\/td>\n<td valign=\"top\" nowrap width=\"559\">\n<p>CMFCShellListCtrl::OnContextMenu &#8216;Delete&#8217; context menu handler&nbsp;does not work<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>I hope you find this information useful.&nbsp; Please let us know if you have any questions.<\/p>\n<p>Pat Brenner, Visual C++ Libraries Development Team<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, I&rsquo;m Pat Brenner, a developer on the Visual C++ Libraries team.&nbsp; In this&nbsp;blog post I would like to share with you the changes that we&rsquo;ve made in ATL and MFC for Visual Studio 2013. One of the major changes we made was to eliminate the ATL DLL altogether.&nbsp; All ATL code is now static, [&hellip;]<\/p>\n","protected":false},"author":270,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[23,140,10],"class_list":["post-1253","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-atl","tag-c","tag-mfc"],"acf":[],"blog_post_summary":"<p>Hello, I&rsquo;m Pat Brenner, a developer on the Visual C++ Libraries team.&nbsp; In this&nbsp;blog post I would like to share with you the changes that we&rsquo;ve made in ATL and MFC for Visual Studio 2013. One of the major changes we made was to eliminate the ATL DLL altogether.&nbsp; All ATL code is now static, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/1253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/270"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}