I have created an activex control a while ago and have integrated it
into a project. The project uses lots of this control, at least 50
instantses. I wanted to add a method to the control but that created
an incompatiblity with the control so when I open my project I get
errors saying the .ocx file could not be loaded. When the project
finally opens all of the activex controls are changed to
pictureboxes. I could go through and reload the new .ocx file and
change all of the pictureboxes to the control but that could take
days.
Am i screwed? Is there a way to add in these methods (public
functions) to the existing control without breaking compatibility?
Thanks.
Mike
Yeah, there are. You can always maintain binary compatability when adding new
functions, by just ignoring the warning when try compiling the OCX/DLL.
Since it sounds like you went ahead and broke compatability, one "quick fix" option
you have is to use the new control in a new project, and save it. Open the FRM file
in Notepad and cut out the Object= line up top and paste that over the one(s) in
your old project's FRM file(s). Do the same with the VBP file. Oughta open right
up.
--
.NET: It's About Trust!
http://vfred.mvps.org
When VB replaced your control with pictureboxes, you didn't save the project
in that state, did you? If so, there's a lot of work ahead.
If not, and you have a copy of the original OCX somewhere, there's still
hope.
Binary Compatibility
http://www.vbsight.com/BinaryComp.htm
If the original is gone for good, you can manually replace the Object lines
in the form files, as Karl suggested.... Then, stick "to the rules" when it
comes to compatibility and think of this as a learning experience <g>