FIX: Visual C++ 2008 MFC application that was created by using Visual Studio 2008 freezes


Consider the following scenario:

  • You develop a Visual C++ Microsoft Foundation Class (MFC) application by using Microsoft Visual Studio 2008.
  • You run the application together with a UI Automation client, such as UISpy or Inspect.
  • You try to close the MFC application.
In this scenario, the application may freeze.


This fix removes the CMFCComObject class so that the AfxOleLockApp method is no longer called. Therefore, the accessibility application or the Automation client is also closed automatically when the MFC application shuts down.

Hotfix information

A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that this article describes. Apply it only to systems that are experiencing this specific problem.

To resolve this problem, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft website:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.


 To apply this hotfix, you must have Visual Studio 2008 Service Pack 1 (SP1) installed.

Restart requirement

You do not have to restart the computer after you install the hotfix if the affected files are not being used at the time of installation. We recommend that you close all Visual Studio 2008-related components before you install the hotfix.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.