Microsoft KB Archive/820627

= BUG: You receive a &quot;System.Runtime.InteropServices.COMException&quot; message when you bind an ImageList ActiveX control to a CoolBar ActiveX control =

Article ID: 820627

Article Last Modified on 11/26/2007

-

APPLIES TO


 * Microsoft Visual Basic 2005
 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition
 * Microsoft Visual C# .NET 2003 Standard Edition
 * Microsoft Visual C# .NET 2002 Standard Edition

-





SYMPTOMS
In Microsoft Visual Studio 2005 or in Microsoft Visual Studio .NET, when you set the ImageList property of the CoolBar ActiveX control to the ImageList ActiveX control, and then you run the application, you receive the following exception:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in axinterop.comctl3.dll

Additional information: Invalid property value.

Note You cannot set the ImageList property of the CoolBar ActiveX control in the Properties window.



CAUSE
Microsoft Visual Basic 2005, Microsoft Visual Basic .NET, and Microsoft Visual C# .NET interpret the ImageList property of the CoolBar ActiveX control as a read-only property. Therefore, Visual Basic 2005, Visual Basic .NET, and Visual C# .NET throw an exception when you set the ImageList property of the CoolBar ActiveX control to the ImageList ActiveX control.



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 problem
 Start Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET. Start a new Microsoft Windows application by using Visual Basic 2005, Visual Basic .NET, or Visual C# .NET.

By default, a form that is named Form1 is created. On the Tools menu, click Add/Remove Toolbox Items.

Note If you are using Visual Studio 2005, click Choose ToolBox Items on the Tools menu.

Note If you are using Microsoft Visual Studio .NET 2002, click Customize Toolbox on the Tools menu. On the COM Components tab, click Microsoft CoolBar Control, version 6.0 and Microsoft ImageList Control 6.0 (SP4), and then click OK. From the toolbox, drag Microsoft CoolBar Control, version 6.0 and Microsoft ImageList Control 6.0 (SP4) to Form1.

Note If you are using Visual Studio .NET (2002), drag Microsoft CoolBar Control, version 6.0 and Microsoft ImageList Control 6.0 (SP4) from the toolbox to Form1. From the toolbox, drag a Button control to Form1.</li>  Add the following code to the Click event of Button1.

Visual Basic 2005 or Visual Basic .NET code 'Set the ImageList property of the CoolBar control to the ImageList control. AxCoolBar1.ImageList = AxImageList1 Visual C# .NET code //Set the ImageList property of the CoolBar ActiveX control. axCoolBar1.ImageList =axImageList1; </li> On the Debug menu, click Start.</li> On Form1, click Button1.

You receive the exception mentioned in the &quot;Symptoms&quot; section of this article.</li></ol>

<div class="references_section">