This documentation is archived and is not being maintained.

Porting 16-Bit MFC to 32-Bit MFC

Visual Studio .NET 2003

This article gives tips for porting your MFC application from 16-bit to 32-bit.

Version 3.0 and later of the Microsoft Foundation Class Library (MFC) uses the Win32 application programming interface (API). Many of the Win32 API functions are encapsulated in MFC class member functions. However, one of the fundamental tenets of programming with MFC is that you can always make direct calls to the Windows API.

Differences between the 16-bit versions of MFC and the 32-bit versions include:

  • The packing of lParam and wParam in the CWnd members OnCommand and OnParentNotify has changed from 16-bit MFC. For more information, see Changing Message Handlers.
  • The CTime class has constructors that accept system and file times from Win32. For more information, see Date and Time: SYSTEMTIME Support.
  • The class library provides new member functions that wrap many Win32 API functions, including many Win32 GDI functions.
  • Class CWinThread supports multithreaded programming. For more information, see the article Multithreading with C++ and MFC.
  • Most of the class library is enabled for Unicode and for Double-Byte Character Set (DBCS) programming. The database classes are the exception. This enabling means that many class member functions now take character and string parameters of types based on type TCHAR.
  • The 32-bit MFC static link and dynamic-link libraries are named differently from the 16-bit libraries. See MFC Library Versions.
  • Some features of the class library are no longer available in the 32-bit environment. See the article Features No Longer Available in MFC.

The 32-bit CTime class differs from the 16-bit version. For details, see the article Date and Time: SYSTEMTIME Support.

See Also

Porting 16-Bit Code to 32-Bit Windows