Home > Programming > A Comprehensive comparison of the MFC & ATL changes in VS 2017 RC compared to Visual Studio 2015 Update 3 (Part 1)

A Comprehensive comparison of the MFC & ATL changes in VS 2017 RC compared to Visual Studio 2015 Update 3 (Part 1)

January 2, 2017

Following on from my May 2015 Blog post articles (https://naughter.wordpress.com/2015/05/07/a-comprehensive-comparison-of-the-mfc-atl-changes-in-vs-2015-rc-compared-to-visual-studio-2013-update-4/ & https://naughter.wordpress.com/2015/05/13/a-comprehensive-comparison-of-the-mfc-atl-changes-in-vs-2015-rc-compared-to-visual-studio-2013-update-4-part-2/) where I check out what’s new in MFC & ATL for Visual Studio 2015, here is an equivalent article for the upcoming release of VS 2017 which should be released shortly. Please note that this review is based on the VS 2017 Release Candidate (Build 26014.00) which was released on December 15 2016.

 

afx.h

  • Top of module: The checks in VC 2015 which warned about MFC deprecation when compiled for MBCS have been removed. This warning was previously supressed using the pre-processor value NO_WARN_MBCS_MFC_DEPRECATION

afxtoolbarbutton.h

  • Line 9: Minor change to a comment.

afxwinforms.h

  • Line 19: Minor change to a comment.

atlalloc.h

  • Line 22, 31, 39, 47, 55, 117-119, 126, 132-134, 141, 147-149, 156, 162-164, 171: Removed code which dealt with some errors for the defunct /Wp64 compiler option by using a ATL_W64 pre-processor macro.
  • Line 24, 93: Minor change to comments
  • Line 461: Code now uses this pointer explicitly in CHeapPtr::Allocate to make lookup be deferred until the template is actually instantiated. For information on the reasons for this change which is the biggest cause of differences as described throughout this blog post please see https://isocpp.org/wiki/faq/templates#nondependent-name-lookup-members. I believe this is because VC++ is in the process of supporting expression better ISO C++ conformance. For more information about this process please see https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/. I will over the next few months by updating my code to address any issues when compiled with /permissive-.
  • Line 461: Code now uses this pointer explicitly in CHeapPtr::Reallocate to make lookup be deferred until the template is actually instantiated.

atlcoll.h

  • Line 114: Minor change to fixup layout of whitespace.
  • Line 335, 356: Minor change to comment to fix spelling mistake (if you are using American English!)
  • Line 425: Addition of the keyword typename for instantiation of the “pch” local variable in the CStringElementTraitsI::Hash method.
  • Line 458: New using typename CElementTraitsBase<T>::INARGTYPE declaration in CStringRefElementTraits class.
  • Line 464: Addition of the keyword typename for instantiation of the “pch” local variable in the CStringRefElementTraits::Hash method.
  • Line 1034: Minor change to comment to fix spelling mistake.
  • Line 1475: CAtlList::RemoveAll is now declared as throw()
  • Line 1715: CAtlList::RemoveHeadNoReturn is now declared as throw()
  • Line 1757: CAtlList::RemoveTailNoReturn is now declared as throw()
  • Line 1834: CAtlList::RemoveAt is now declared as throw()
  • Line 2871: CAtlMap::RemoveNode is now declared as throw()
  • Line 2891: CAtlMap::RemoveAtPos is now declared as throw()
  • Line 3130: Minor change to comment to fix spelling mistake
  • Line 3311: CRBTree::SetNill is now declared as throw()
  • Line 3589: CRBTree::FreeNode is now declared as throw()
  • Line 3780: CRBTree::SwapNode is now declared as throw()
  • Line 3840: CRBTree::RBDeleteFixup is now declared as throw()
  • Line 4190-4193: New using statements for KINARGTYPE, VINARGTYPE, VOUTARGTYPE & CPair types
  • Line 4271: Code now uses this pointer explicitly in CRBMap::RemoveKey to make lookup be deferred until the template is actually instantiated.
  • Line 4286-4288: New using statements for KINARGTYPE, VINARGTYPE & CPair types
  • Line 4343: Code now uses this pointer explicitly in CRBMultiMap::RemoveKey to make lookup be deferred until the template is actually instantiated.
  • Line 4363 & 4378: Code now uses this pointer explicitly in CRBMultiMap::GetNextWithKey to make lookup be deferred until the template is actually instantiated.

atlcom.h

  • Line 81-82: Minor change to fixup layout of whitespace.
  • Line 966-967, 1707-1709, 1738: Update to SAL for CSecurityDescriptor::CopyACL
  • Line 2226: Code now uses this pointer explicitly in BEGIN_COM_MAP to make lookup be deferred until the template is actually instantiated
  • Line 2615: Minor change to comment to fix spelling mistake
  • Line 2912-2941: Code now uses this pointer explicitly in CComObject class to make lookup be deferred until the template is actually instantiated
  • Line 3002-3031: Code now uses this pointer explicitly in CComObjectCached class to make lookup be deferred until the template is actually instantiated
  • Line 3086-3111: Code now uses this pointer explicitly in CComObjectNoLock class to make lookup be deferred until the template is actually instantiated
  • Line 3165: Code now uses this pointer explicitly in CComObjectGlobal class to make lookup be deferred until the template is actually instantiated
  • Line 3180-3186: Code now uses this pointer explicitly in CComObjectStack class to make lookup be deferred until the template is actually instantiated
  • Line 3224-3268: Code now uses this pointer explicitly in CComObjectStackEx class to make lookup be deferred until the template is actually instantiated
  • Line 3333-3334, 3348, 3356, 3361: New typedef for _MyCComObjectRootEx in CComAggObject class
  • Line 3368-3382: Code now uses this pointer explicitly in CComAggObject class to make lookup be deferred until the template is actually instantiated
  • Line 3459-3460, 3475, 3484, 3491: New typedef for _MyCComObjectRootEx in CComPolyObject class
  • Line 3483-3512: Code now uses this pointer explicitly in CComPolyObject class to make lookup be deferred until the template is actually instantiated
  • Line 3592-3623: Code now uses this pointer explicitly in CComTearOffObject class to make lookup be deferred until the template is actually instantiated
  • Line 3592: Addition of the keyword typename in the CComTearOffObject constructor
  • Line 3632-3633, 3648, 3656, 3661: New typedef for _MyCComObjectRootEx in CComCachedTearOffObject class
  • Line 3638, 3641: Addition of the keyword typename in the CComCachedTearOffObject constructor
  • Line 3668-3681: Code now uses this pointer explicitly in CComCachedTearOffObject class to make lookup be deferred until the template is actually instantiated
  • Line 3803-3850: Code now uses this pointer explicitly in CComClassFactory2 class to make lookup be deferred until the template is actually instantiated
  • Line 4571-4580: _ATL_EVENT_ENTRY struct declaration has been moved to these lines
  • Line 4662-4836: Code now uses this pointer explicitly in IDispEventSimpleImpl class to make lookup be deferred until the template is actually instantiated
  • Line 5036-5084: Code now uses this pointer explicitly in IDisplEventImpl class to make lookup be deferred until the template is actually instantiated
  • Line 5132: New SINK_ENTRY_INFO_P macro
  • Line 5134: New SINK_ENTRY_EX_P macro
  • Line 5480-5481: CComEnum class declaration has been moved here
  • Line 5483-5484: CComEnumOnSTL class declaration has been moved here
  • Line 5655: There is no default for the ThreadModel template parameter for the CComEnum class now.
  • Line 5786: There is no default for the ThreadModel template parameter for the CComEnumOnSTL class now.
  • Line 5825: Addition of the keyword typename for the iter local variable in the ICollectionOnSTLImpl::Get_Item method
  • Line 5966-5967: New CONNECTION_POINT_ENTRY_P macro
  • Line 6311: Code now uses this pointer explicitly in IConnectionPointImpl class to make lookup be deferred until the template is actually instantiated

atlcomcli.h

  • Line 8: Minor change to fixup layout of whitespace.
  • Line 228: CComPtrBase::IsEqualObject is now longer declared inline
  • Line 329-514, 586-600: Code now uses this pointer explicitly in CComPtr class to make lookup be deferred until the template is actually instantiated
  • Line 625-687: Code now uses this pointer explicitly in CComQIPtr class to make lookup be deferred until the template is actually instantiated

ATLComTime.h

  • Line 1095: COleDateTime::COleDateTime(const DBTIMESTAMP&) is now declared as throw().
  • Line 1110: COleDateTime::GetAsDBTIMESTAMP is now declared as throw().

atlctl.h

  • Line 95: Minor change to fixup layout of whitespace.
  • Line 1592: Code now uses this pointer explicitly in CComControl class to make lookup be deferred until the template is actually instantiated
  • Line 1671-2064: Code now uses this pointer explicitly in CComCompositeControl class to make lookup be deferred until the template is actually instantiated
  • Line 2173: Addition of the keyword typename in the IQuickActivateImpl::QuickActivate method

atldb.h

  • Line 1658: Addition of the keyword typename in the IDBInitialize::Uninitialize method
  • Line 1681: Addition of the keyword typename in the IDBInitialize::Initialize method
  • Line 2141: Minor change to comment to fix spelling mistake
  • Line 2698: Minor change to comment to fix spelling mistake
  • Line 4910-4986: Code now uses this pointer explicitly in IDBPropertiesImpl class to make lookup be deferred until the template is actually instantiated
  • Line 4965, 4977, 5186, 5199: Code now uses CUtlPropsBase::EnumUPropSetFlags:: scoping for UPROPSET_USERINIT define
  • Line 5000: Addition of the keyword typename in the IDBPropertiesImpl::GetPropertyInfo method
  • Line 5095: Addition of the keyword typename in the IDBPropertiesImpl::SetProperties method
  • Line 6053-6098: Code now uses this pointer explicitly in ICommandPropertiesImpl class to make lookup be deferred until the template is actually instantiated
  • Line 6113: Code now uses CUtlPropsBase:: scoping when calling SetPropertiesArgChk method
  • Line 6116: Minor change to comment to fix spelling mistake
  • Line 6275-6280: Addition of the keyword typename in the ICommandImpl::CreateRowset method
  • Line 6381: Addition of the keyword typename in the ICommandTextImpl::GetCommandText method
  • Line 6424: Addition of the keyword typename in the ICommandTextImpl::SetCommandText method
  • Line 6499-6500: Code now uses this pointer explicitly in ISessionPropertiesImpl class to make lookup be deferred until the template is actually instantiated
  • Line 6554: Code now uses CUtlPropsBase:: scoping when calling SetPropertiesArgChk method
  • Line 6558: Minor change to comment to fix spelling mistake
  • Line 6787-6972: Code now uses this pointer explicitly in IAccessorImpl class to make lookup be deferred until the template is actually instantiated
  • Line 6913: Addition of the keyword typename in the IAccessorImpl::CreateAccessor method
  • Line 6917: Minor change fix spelling mistake for TRACE statement text
  • Line 6943: Minor change to comment to fix spelling mistake
  • Line 7045: Addition of the keyword typename in the IAccessorImpl::ReleaseAccessor method
  • Line 7276, 7329: Addition of the keyword typename in the TransferData method
  • Line 7932, 8106: Addition of the keyword typename in the IRowsetChangeImpl::DeleteRows method
  • Line 8098: Minor change to comment to fix spelling mistake
  • Line 8185: Addition of the keyword typename in the IRowsetChangeImpl::SetData method
  • Line 8237, 8270, 8294, 8353, 8362, 8444: Addition of the keyword typename in the IRowsetChangeImpl::InsertRow method
  • Line 8496: Addition of the keyword typename in the IRowsetImpl destructor method
  • Line 8519, 8535, 8617: Addition of the keyword typename in the IRowsetImpl::RefRows method
  • Line 8691: Addition of the keyword typename in the IRowsetImpl::GetDataHelper method
  • Line 8728: Addition of the keyword typename in the IRowsetImpl::CreateRow method
  • Line 8787, 8820, 8850, 8876, 8898, 8980, 9000: Addition of the keyword typename in the IRowsetImpl::GetNextRowsSkipDeleted method
  • Line 9125: Addition of the keyword typename in the IRowsetImpl::GetNextRows method
  • Line 9382: Addition of the keyword typename in the IRowsetImpl::RestartPosition method
  • Line 9541: Addition of the keyword typename in the IRowsetLocateImpl::GetRowsAt method
  • Line 9565-9745: Code now uses this pointer explicitly in IRowsetLocateImpl class to make lookup be deferred until the template is actually instantiated
  • Line 9678: Addition of the keyword typename in the IRowsetLocateImpl::GetRowsByBookmark method
  • Line 9891, 9895: Addition of the keyword typename in the IRowsetIdentity::IsSameRow method
  • Line 9970-9981: Code now uses this pointer explicitly in IObjectWithSiteSessionImpl class to make lookup be deferred until the template is actually instantiated
  • Line 10005-100017: Code now uses this pointer explicitly in IRowsetCreatorImpl class to make lookup be deferred until the template is actually instantiated
  • Line 10076-100077: Code now uses this pointer explicitly in IRowsetInfoImpl class to make lookup be deferred until the template is actually instantiated
  • Line 10081: Minor change to comment to fix spelling mistake
  • Line 10171: Addition of the keyword typename in the IRowsetInfoImpl::GetSpecification method
  • Line 10283-10498: Code now uses this pointer explicitly in IRowsetNotifyCP class to make lookup be deferred until the template is actually instantiated
  • Line 10661: Code now uses this pointer explicitly in CRowsetImpl class to make lookup be deferred until the template is actually instantiated
  • Line 10707: Code now uses this pointer explicitly in CSchemaRowsetImpl class to make lookup be deferred until the template is actually instantiated
  • Line 11421: Addition of the keyword typename in the IRowsetUpdateImpl::GetOriginalData method
  • Line 11585, 11647: Addition of the keyword typename in the IRowsetUpdateImpl::GetPendingRows method
  • Line 11747: Addition of the keyword typename in the IRowsetUpdateImpl::Undo method
  • Line 11776: Minor change to comment to fix spelling mistake
  • Line 11881, 11983: Addition of the keyword typename in the IRowsetUpdateImpl::Undo method
  • Line 12141: Minor change to comment to fix spelling mistake
  • Line 12242, 12381, 12542: Addition of the keyword typename in the IRowsetUpdateImpl::Update method

atldbcli.h

  • Line 290, 334: Minor update to the text of a comment
  • Line 1232: Minor change to comment to fix spelling mistake
  • Line 2693: Minor change to comment to fix spelling mistake
  • Line 2988: Minor change to comment to fix spelling mistake
  • Line 3188: Fix for CDynamicAccessor::strcpyT method returning a value when it is declared as returning void
  • Line 3250: Minor change to comment to fix spelling mistake
  • Line 3777: Minor change to comment to fix spelling mistake
  • Line 4912-6116: CRowset, CBulkRowset, CVBufHelper, CVirtualBuffer & CArrayRowset classes are now declared here
  • Line 6149-6208: Code now uses this pointer explicitly in CAccessorRowset class to make lookup be deferred until the template is actually instantiated
  • Line 6564: Minor change to comment to fix spelling mistake
  • Line 6794: Minor change to comment to fix spelling mistake
  • Line 7104-7112: Code now uses this pointer explicitly in CTable class to make lookup be deferred until the template is actually instantiated
  • Line 7385-7521: Code now uses this pointer explicitly in CCommand class to make lookup be deferred until the template is actually instantiated

atldbschi.h

  • Line 43: Minor change to fixup layout of whitespace
  • Line 102-104: Code now uses this pointer explicitly in CSchemaRowset class to make lookup be deferred until the template is actually instantiated
  • Line 132-190: Code now uses this pointer explicitly in CRestrictions class to make lookup be deferred until the template is actually instantiated

atldef.h

  • Line 91: #ifndef RC_INVOKED line has been moved to this line to cover more code
  • Line 94: Minor change to a comment.
  • Line 603-607: #ifndef RC_INVOKED line has been added to cover code here

atlexcept.h

  • Line 91: Minor change to comment to fix spelling mistake
  • Line 94: AtlThrowImpl is now declared as __declspec(noreturn)
  • Line 112: AtlThrowLastWin32 is now declared as __declspec(noreturn)

atlhost.h

  • Line 138: Minor change to fixup layout of whitespace
  • Line 1080: Minor change to comment to fix spelling mistake (if you are using American English!)
  • Line 2580: Minor change to comment to fix spelling mistake. Unfortunately the fix introduces another spelling mistake!
  • Line 2581: Minor change to comment to fix spelling mistake
  • Line 2584: Minor change to comment to fix spelling mistake
  • Line 2723: Addition of the keyword typename in the AtlAxDialogCreateT method

atlface.h

  • Line 122: Removal of MIDL_user_allocate and MIDL_user_free function declarations

atlimage.h

  • Line 37: Compiler errors 4263 & 4264 are now disabled in this module

atlsafe.h

  • Line 91: Minor change to fixup layout of whitespace
  • Line 335, 350: Addition of the keyword typename in the CComSafeArray::GetAt methods

atlsocket.h

  • Line 78: The first override of CSocketAddr:FindAddr is now declared as throw(). All the other Find* methods in this class were already declared as throw().
  • Line 110: Minor change to comment to fix spelling mistake

atlstr.h

  • Line 102: Minor change to fixup layout of whitespace

atlime.h

  • Line 634-636: Minor change to fixup layout of whitespace
  • Line 656: CTime::GetYear is now declared as throw().
  • Line 665: CTime::GetMonth is now declared as throw().
  • Line 674: CTime::GetDay is now declared as throw().
  • Line 683: CTime::GetHour is now declared as throw().
  • Line 692: CTime::GetMinute is now declared as throw().
  • Line 701: CTime::GetSecond is now declared as throw().
  • Line 710: CTime::GetDayOfWeek is now declared as throw().

atlutil.h

  • Line 1257: Addition of the keyword typename in the CThreadPool:: ThreadProc method
  • Line 3563: Addition of the keyword typename in the CopyCString method
  • Line 3592: Various parameters to a CStringA::Format call have been fixed in the SystemTimeToHttpDate method.

atlwin.h

  • Line 359-366: CWinTraits, CControlWinTraits, CFrameWinTraits & CMDICHildWinTraits are now declared here
  • Line 706: Minor change to comment to fix spelling mistake
  • Line 2273-2470: Code now uses this pointer explicitly in CAXWindowT class to make lookup be deferred until the template is actually instantiated
  • Line 2517-2637: Code now uses this pointer explicitly in CAXWindow2T class to make lookup be deferred until the template is actually instantiated
  • Line 2875: Code now uses this pointer explicitly in FORWARD_NOTIFICATIONS macro to make lookup be deferred until the template is actually instantiated
  • Line 2883: Code now uses this pointer explicitly in REFLECT_NOTIFICATIONS macro to make lookup be deferred until the template is actually instantiated
  • Line 2889: Code now uses this pointer explicitly in DEFAULT_REFLECTION_HANDLER macro to make lookup be deferred until the template is actually instantiated
  • Line 3141 There is no longer default values for the dwStyle and dwExStyle template parameters for the CWinTraits class
  • Line 3192-3317: Code now uses this pointer explicitly in CWindowImplRoot class to make lookup be deferred until the template is actually instantiated
  • Line 3443-3645: Code now uses this pointer explicitly in CWindowsImplBaseT class to make lookup be deferred until the template is actually instantiated
  • Line 3547, 3550, 3555: Code now uses CWindowImplRoot<TBase>:: scoping in CWindowImplBaseT::WindowsProc method
  • Line 3672-3673: Code now uses this pointer explicitly in CWindowImpl class to make lookup be deferred until the template is actually instantiated
  • Line 3734: Code now uses this pointer explicitly in CWindowWithReflectorImpl class to make lookup be deferred until the template is actually instantiated
  • Line 3780-3828: Code now uses this pointer explicitly in CDialogImplBaseT class to make lookup be deferred until the template is actually instantiated
  • Line 3913, 3923, 3931: Code now uses CWindowImplRoot<TBase>:: scoping in CDialogImplBaseT::DialogProc method
  • Line 3958-4028: Code now uses this pointer explicitly in CDialogImpl class to make lookup be deferred until the template is actually instantiated
  • Line 4073-4355: Code now uses this pointer explicitly in CAxDialogImpl class to make lookup be deferred until the template is actually instantiated
  • Line 4196: Minor change to comment to fix spelling mistake
  • Line 4509-4795: Code now uses this pointer explicitly in CContainedWindowT class to make lookup be deferred until the template is actually instantiated
  • Line 5268, 5271, 5301: Addition of the keyword typename in the AtlModuleRegisterWndClassInfoT function

cstringt.h

    • Line 106, 107: Minor change to fixup layout of whitespace
    • Line 1180-2374: Code now uses this pointer explicitly in CStringT class to make lookup be deferred until the template is actually instantiated
    • Line 2265: Code now uses CThisSimpleString:: scoping in CStringT::FormatV method
    • Line 2279: Code now uses CThisSimpleString:: scoping in CStringT::AllocSysString method
    • Line 2291: Code now uses CThisSimpleString:: scoping in CStringT::SetSysString method
    • Line 2386, 2397, 2408, 2426, 2438, 2451, 2463: Code now uses CThisSimpleString:: scoping in CStringT::operator+ method
    • Line 3016, 3020, 3032, 3038, 3044, 3050, 3056, 3062: New typedef for MyStrTraits in CFixedStringT class
    • Line 3069: Code now uses this pointer explicitly in CFixedStringT class to make lookup be deferred until the template is actually instantiated
    • Line 3176: Addition of the keyword typename in the CStringElementTraits:: Hash method

 

What this means is that in VC 2017 there is no new functionality which has been added to ATL or MFC, only C++ compliance changes, spelling mistake fixups and general bug fixes.

I plan to produce a follow-up blog post where I post the details of the MFC source code diff of VS 2017 compared to VS 2015. Note that since ATL is a header only template library all changes made to ATL are already covered in this blog post article. I would expect most of the MFC source code changes to be similar to the differences as described above along with the usual list of additional bug fixes.

Hopefully this review was useful for those developers thinking of migrating their large ATL / MFC code base to the latest version of Visual Studio. Happy coding.

Advertisements
Categories: Programming
%d bloggers like this: