.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘ActiveX’

BUG: You receive a “System.Runtime.InteropServices.COMException” message when you bind an ImageList ActiveX control to a CoolBar ActiveX control

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.
Resolution
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.

“Invalid Use of New Keyword” error using ADODB object library

Symptoms
When you run a macro that uses the ADODB object in Microsoft Excel, you may receive an error message similar to the following:

Compile Error:
Invalid use of New keyword
Resolution
This problem occurs when all of the following conditions are true: You create a reference to both of the following libraries:Microsoft ActiveX Data Objects 2.1 LibraryMicrosoft DAO 3.6 Object LibraryMicrosoft DAO 3.6 appears before Microsoft ActiveX in the References dialog box.You explicitly refer to the ADODB object in a macro, for example:

Dim rs as ADODB.Recordset NOTE: This problem does not occur when you use the DAO object, and Microsoft DAO 3.6 appears after Microsoft ActiveX in the References dialog box.