Microsoft KB Archive/827217

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

Article ID: 827217

Article Last Modified on 10/21/2005

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Professional Edition

-





SYMPTOMS
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 &quot;0x202d0f51&quot; referenced memory at &quot;0xC0000094&quot;. The memory could not be &quot;written&quot;. Click on OK to terminate the program

OK

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.



RESOLUTION
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:

http://support.microsoft.com/contactus/?ws=support

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  6.0.81.6  1,344,512  Comctl32.ocx



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section.



Steps to reproduce the behavior
 Start a new Visual Basic 6.0 or Visual Basic 5.0 Standard EXE project. On the Projects menu, click Components. In the Components dialog box, add a reference to Microsoft Windows Common Controls 5.0 (Comctl32.ocx). Add a ListView control to Form1. By default, ListView1 is created.  Add the following code to Form1: Private Sub Form_Load ListView1.View = lvwReport ListView1.ColumnHeaders.Add, , &quot;TestHeader&quot; ListView1.ListItems.Add, , &quot;Test&quot; End Sub </li> On the File menu, click Make EXE.</li> 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.</li> Run Project1.exe.</li></ol>

<div class="references_section">