Porting Applications Created with Earlier Versions of MFC for Windows CE

For the most part, it is a simple process to use the current version of MFC for Windows CE to compile applications created with previous versions. However, you may need to make a few minor adjustments to guarantee compatibility.

For example, versions 1.0 and 2.0 of MFC for Windows CE automatically create command bars whenever they create frame windows. You should eliminate these command bars to ensure that your application is compatible with the current version of MFC for Windows CE. You can create your own command bars, manually or with the help of one of the MFC application wizards, by using the CCeCommandBar class.

Another possible backward compatibility issue concerns the CWinApp constructor. The CWinApp constructor in the current version of MFC for Windows CE takes one optional parameter, whereas in earlier versions CWinApp takes up to two optional parameters. To avoid compiler errors due to this difference, simply rewrite your calls to the CWinApp constructor so that they use a single optional parameter. For more information, see CWinApp.

In addition, version 2.0 of MFC for Windows CE automatically paints the client area before processing an application’s OnNewDocument handler. The current version of MFC for Windows CE, however, performs no painting before the application calls either the OnNewDocument handler or the AfxMsgBox function. If your application engages in extensive processing before calling the OnNewDocument handler and you want to avoid a blank screen, call UpdateWindow.