Steve Teixeira
Microsoft Corporation
June 2005
The Microsoft Foundation Class (MFC) Library continues to be the most popular C++ application framework in use today. Thousands of independent software vendors (ISVs) and IT departments continue to invest heavily in MFC, both for existing code and for new projects. Microsoft is committed to ensuring MFC remains a competitive and viable application framework and MFC developers are equipped to take advantage of new platform technologies.
MFC in Visual Studio 2005
Microsoft has made some key investments in the MFC Library for Visual Studio 2005, particularly in the areas of reliability, security, and .NET integration. .NET integration enables MFC applications to leverage the power and productivity of the .NET platform as a natural extension of MFC. The reliability and security enhancements in MFC make for a more productive development process with fewer end-user issues, and existing MFC applications can take advantage of these enhancements with little more than a simple recompile in many cases.
.NET Integration
Visual Studio 2005 fully supports the use of the .NET framework from within any MFC application. Visual C++ makes .NET more accessible from native code than ever before, allowing developers to combine native and managed modules in a single executable and to seamlessly call between the two. In addition to the ease of access to .NET code and APIs from MFC applications, the MFC Library also supports hosting of WinForms controls and forms from within MFC applications. This enables MFC developers to leverage the rich component model and design-time support for WinForms without compromising existing investment in MFC.
Security
One of the major themes of Visual C++ 2005 is enhanced security features that make it easy for developers to eliminate potential points of vulnerability and reduce the overall surface area exposed to attackers. This enhanced security starts in the compiler, which generates special code to guard against a variety of stack-based exploits. Heavy investment has also been made in securing the C Runtime Library (CRT) to eliminate many of the potential attack vectors found in previous versions of the libraries. The secure CRT replaces all of the unsafe CRT functions with more secure equivalents as well as adding additional parameter checking to existing CRT functions. The MFC Library now fully leverages the compiler’s security features as well as those of the secure CRT, meaning that MFC applications linked with the Visual Studio 2005’s MFC Library pose a greatly reduced opportunity for intentional exploits and a significantly reduced likelihood of unintentional memory overwrite defects.
Reliability
Recognizing “DLL hell” as a major obstacle to long-term application reliability, MFC now supports Windows Side-by-Side (WinSxS) installation, allowing libraries to be appropriately versioned. Side-by-side installations of MFC enabled by WinSxS technology reduce the errors often associated with DLL version incompatibility and enables MFC libraries to be much more effectively serviced and updated with a minimum of end-user impact.
Further enhancing reliability, Microsoft has also fixed more defects in the Visual Studio 2005 release of MFC than with any previous release. Building on MFC today will not only yield more secure applications but more reliable and stable applications as well.
Beyond Visual Studio 2005
MFC continues to be the C++ application framework of choice for many developers because the breath and depth of support that MFC provides for the Microsoft platforms remains unmatched by other frameworks. Visual Studio 2005 makes it possible for the C++ developer to leverage existing C++ code, the strengths of MFC, and the advantages of .NET, all within a single application.
Looking beyond Visual Studio 2005, C++ developers should expect deepened integration between MFC and the .NET framework. After the release of Windows Longhorn, Microsoft intends to add MFC support for key Longhorn APIs and features. Microsoft also intends to support the Avalon user interface framework in MFC, providing MFC developers with a bridge to the future of platform user interface design. In essence, as the platform evolves, developers can look forward to seeing MFC updated to leverage the latest managed and native APIs and frameworks.
MFC developers have access to more frameworks than any other type of developer on the platform. As such, MFC developers are free to leverage the best from all worlds as it makes business and technological sense to do so. Microsoft fully expects to support this capability into the foreseeable future.
Steve Teixeira is the Director of Partner Strategy for Microsoft Visual C++. You can contact Steve to provide feedback on this document at stevetei@microsoft.com.