FIX: A stack overflow occurs when MFC ActiveX control containers enter a state of infinite recursion in Visual C++

Article translations Article translations
Article ID: 192942 - View products that this article applies to.
This article was previously published under Q192942
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

SYMPTOMS

Under certain circumstances, MFC ActiveX control containers will enter a state of infinite recursion that eventually leads to a stack overflow. The symptoms of this are when the position of a control site changes, the program will seemingly hang and eventually produce a stack overflow (0xC00000FD) operating system exception. The stack trace looks like this:
   COleControlSite::MoveWindow
   COleControl::XOleInPlaceObject::SetObjectRects
   COleControl::OnSetObjectRects
   COleControlSite::MoveWindow
   ...
				

CAUSE

When the position of the control site changes, the container code changes the position of the reflector window (if present) and the tracker rectangles (if present). The control container code eventually calls COleControl::XOleInPlaceObject::SetObjectRects. (See CTLINPLC.CPP in the MFC source.) SetObjectRects() makes a call to GetOuterWindow(), which returns the reflector window if present. If the reflector window variable is NULL then the same window object is returned, MoveWindow is then called using the returned window object. This causes MoveWindow to be called on itself, resulting in a recursive loop.

RESOLUTION

One workaround is to copy the Visual C++ 5.0 version of the MFC42.DLL (File version: 4.21.7303) to the home directory of the program experiencing this problem. This will cause the program to use the older version of MFC, instead of the MFC42.DLL that is located in the Windows system directory.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed in this article. This bug has been fixed in the Visual Studio 6.0 Service Pack 1.

To obtain this service pack, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/vstudio/Aa718362.aspx
For more information about Visual Studio 6.0 Service Pack 1, click the following article numbers to view the articles in the Microsoft Knowledge Base:
193009 Visual Studio 6.0 Service Pack 1 Readme
194022 Visual Studio 6.0 service packs, what, where, why
194295 How to tell that a Visual Studio service pack is installed

MORE INFORMATION

This bug has been found in WordPerfect 8 that ships as part of Corel Office Suite 8. This bug occurs only with the Visual C++ 6.0 version of the MFC42.DLL.

Properties

Article ID: 192942 - Last Review: February 23, 2014 - Revision: 5.2
APPLIES TO
  • Microsoft Foundation Class Library 4.2, when used with:
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbnoupdate kbqfe kbvs600sp1fix kbvc600sp1fix KB192942

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com