FIX: Access violation in Comctl32.ocx on Windows 2000 or later


You may receive an access violation error message under the following conditions:
  • Your computer is running Microsoft Windows 2000 or later.
  • Your computer is running an application that sets a WinEvent hook.
  • You start an application that uses the ListView control or the TreeView control from Microsoft Windows Common Controls 5.0 (Comctl32.ocx).
You may receive an error message similar to the following:
Project1: Project1.exe - Application Error

The instruction at "0x202d0f51" referenced memory at "0xC0000094". The memory could not be "written". Click on OK to terminate the program


Typically, accessibility applications that are built on Microsoft Active Accessibility, such as Narrator, set a WinEvent hook. However, utilities that run on the Microsoft Windows XP Tablet PC Edition operating system also set a WinEvent hook.


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

Note You must have a Visual Studio license agreement to obtain this hotfix.

To resolve this problem, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site: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.

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version   Size       File name
18-Aug-2003 20:25 1,344,512 Comctl32.ocx


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

More Information

Steps to reproduce the behavior

  1. Start a new Visual Basic 6.0 or Visual Basic 5.0 Standard EXE project.
  2. On the Projects menu, click Components.
  3. In the Componentsdialog box, add a reference to Microsoft Windows Common Controls 5.0(Comctl32.ocx).
  4. Add a ListView control to Form1. By default, ListView1 is created.
  5. Add the following code to Form1:
    Private Sub Form_Load()
    ListView1.View = lvwReport
    ListView1.ColumnHeaders.Add , , "TestHeader"
    ListView1.ListItems.Add , , "Test"
    End Sub
  6. On the File menu, click Make EXE.
  7. Start an application that sets up a WinEvent hook. Narrator is one application that does this.

    To start Narrator, click Start, point to Programs, point to Accessories, point to Accessibility, and then click Narrator.
  8. Run Project1.exe.


For more information, click the following article number to view the article in the Microsoft Knowledge Base:

896559 FIX: The Windows Common Controls Mscomctl.ocx or Comctl32.ocx may cause your application or the Visual Basic 6 IDE to unexpectedly quit, or you may receive a "Divide By Zero" error message


文書番号:827217 - 最終更新日: 2005/10/21 - リビジョン: 1