2

I have OCX created using VB 6.0. And this OCX has custom activex controls in it. The custom controls are used in my application. I have installed my application in a system in which I have registered mu first application.

My second application needs the custom controls which are available in my OCX , few enhancements in previous controls and new custom controls.

For this purpose I have created new OCX with previous controls and new control added. In this case in future if I need different controls I need to create more OCX files. This is difficult to maintain different OCX.

If I add new functionalities in the existing OCX and register in the system, already existing application couldn't able to find the previous version of activex control.

How to add new features in already existing ocx with out affecting the applications already using these controls?

Thanks

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
srajeshnkl
  • 883
  • 3
  • 16
  • 49

2 Answers2

3

Publishing a component with "Binary Compatibility" allows this (with several caveats involving what you can safely change) by examining the existing version of the activex control and then re-using IDs from the type library in the new version at compile time.

See here for an explanation: http://wynport.wynsys.net/Visual_Basic_Binary_Compatibility.htm which includes a list of what incremental changes you can make.

Alex K.
  • 171,639
  • 30
  • 264
  • 288
  • Thanks for your valuable reply. Using "Binary Compatibility" works for me. – srajeshnkl Jul 21 '12 at 07:32
  • Those "several caveats" have to do with breaking the COM contract. In an interface, you can't alter method names, add or remove parameters from a method signature, or change parameter or return types. In order to do any of these things, you have to add a new interface to the component. While you can add new methods to the bottom of an interface and get away with it, it's not good practice. – BobRodes May 20 '14 at 22:02
3

When you compile your project, Visual Basic only creates new Class and Interface IDs when necessary. It preserves the class and interface IDs from the previous version(s) so that programs compiled using an earlier version will continue to work. If you are making a change that will result in an incompatible version, Visual Basic will warn you. If you want to maintain compatibility with older, released versions of an ActiveX component.

Ref: http://support.microsoft.com/kb/161137

To make your control binary compatible,

  • Open the properties dialog of project
  • Select Component tab
  • Select Binary Compatibility radio button
  • Browse your existing control which you have compiled
  • Click OK button and recompile your project
Siddiqui
  • 7,662
  • 17
  • 81
  • 129