FIX: Using CEditView and _AFXDLL Fails on Windows NT

Last reviewed: September 18, 1997
Article ID: Q113423
1.00 WINDOWS kbprg kbfixlist kbbuglist

The information in this article applies to:

  • The Microsoft Foundation Classes (MFC) included with:

        - Microsoft Visual C++ for Windows, version 1.0
    

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 reference words: wow afxdll__afxdll 1.00 2.00
KBCategory: kbprg kbfixlist kbbuglist
KBSubcategory: MfcUI
Keywords : kb16bitonly MfcUI kbbuglist kbfixlist kbprg
Technology : kbMfc
Version : 1.00
Platform : WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.