Derek B. Bell
Derek B. Bell

Reputation: 319

How to update ActiveX controls within a C# project in Visual Studio 2005

Please explain how to replace the ActiveX controls within a Visual Studio 2005 project (C#) to updated versions.

Upvotes: 1

Views: 1525

Answers (3)

Fred
Fred

Reputation: 1

My company makes ActiveX controls. The simplest way in Visual Studio is to run "clean" on the project and then build. This step will remove the wrapper assemblies and rebuild them. If there were any changes in the new ActiveX control, say a new property, then the signatures of the old assemblies, which convert the COM types to .NET types, won't match and that is why you have to rebuild them.

Upvotes: 0

SuperLucky
SuperLucky

Reputation: 605

Eric J's answer works, however there is two references for an activeX control, one under the name space of InterOP, another is under AxInterOp. Deleting and re-adding COM reference can update Interop dll, but for AxInterop dll, you need to drag one new control to the form to make visual studio auto generate for you.

(In some case, your update of activeX control will make the form designer crash. If that happens, you will need to use aximp.exe to generate AxInterop dll manually.)

Upvotes: 0

Eric J.
Eric J.

Reputation: 150118

Visual Studio knows what ActiveX controls are available, and where to find them, by examining the registry. That's essentially what regsvr32 does... create appropriate registry entries for COM objects (including ActiveX controls).

To upgrade your controls:

  • Close Visual Studio (for good measure... not sure if this is a strict requirement)
  • Install the updated ActiveX controls using their installer or regsvr32 as appropriate
  • If the old version and new version have the same COM interface, you're done. If not, you'll need to fix the references section of your project (delete the old reference, add a new COM reference)

Upvotes: 2

Related Questions