FIX: Using CEditView and _AFXDLL Fails on Windows NT

ID: Q113423


The information in this article applies to:


SYMPTOMS

Running an application that uses the CEditView class from the Microsoft Foundation Class (MFC) Libraries in conjunction with an _AFXDLL dynamic- link library (DLL) causes the following error to be generated when the application is run on Windows NT version 3.1:

<Application Name> caused an exception in the Win16 Subsystem

Click on CLOSE to terminate the application Click on CANCEL to debug the application Click on IGNORE to continue, you should save your work in a new file
If the user chooses IGNORE, the program will continue safely.


CAUSE

The exception is caused by a bug in the Windows NT Win16 subsystem.


RESOLUTION

As mentioned above the problem can safely be ignored by selecting IGNORE when the exception occurs. However you may wish to permanently prevent the exception from occurring.

The problem can be avoided by rebuilding the shared version of the MFC library (MFC200.DLL or MFC200D.DLL) by changing line 44 of VIEWEDIT.CPP from


   static const UINT NEAR nMsgFindReplace =
       ::RegisterWindowMessage(FINDMSGSTRING); 
to the following:

   static char BASED_CODE szFINDMSGSTRING[] = FINDMSGSTRING;
   static const UINT NEAR nMsgFindReplace =
       ::RegisterWindowMessage(szFINDMSGSTRING); 
Once the changes are made, the DLL (MFC250.DLL or MFC250D.DLL) must be rebuilt. For further information on how to do this, see Appendix B of the "Class Libraries User's Guide" or the file README.TXT in the MFC\SRC directory (by default, \MSVC\MFC\SRC\README.TXT).


STATUS

Microsoft has confirmed this to be a problem in Windows NT version 3.1. This problem has been corrected in MFC version 2.5 supplied with Visual C++ version 1.5.


MORE INFORMATION

The DLLHUSK MFC sample can be used to illustrate this problem. Running DLLHUSK version 1.0 on Windows NT version 3.1 generates the exception error. DLLHUSK version 1.0 is supplied with Visual C++ for Windows, version 1.0, and uses MFC version 2.0. Running DLLHUSK version 2.0 on Windows NT version 3.1 does not generate the exception error. DLLHUSK version 2.0 is supplied with Visual C++ for Windows, version 1.5, and uses MFC version 2.5.

Additional query words: wow afxdll__afxdll 1.00 2.00


Keywords          : kb16bitonly kbMFC KbUIDesign kbVC 
Version           : 1.00
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: July 21, 1999