last day (15 days later) » 

3:33 PM
0
Q: How to upgrade VB6 Design components?

Mark WSo I had this legacy project fall into my lap here recently. This application crashes at random intervals, and appears to have memory leak. First off, I am not a VB6 developer. I know virtually nothing about the language, or the IDE. Both of which I find pretty insufferable :(. Nevertheless, I ha...

 
OCX controls are COM components so (if they've been written correctly) just installing and registering the latest version should do it. It's a lot more work to completely break compatibility to the point that it doesn't update automatically. Also, once you've "broken the form" (missing control references) and saved it over the top, you'll need to restore an older version.
 
@Deanna So if I understand you correctly, I should be able to remove the reference from the vbp, open the project and add the reference to the newer version, save, revert the forms that were affected but leave the changes to the vbp, then reload and have it work? Or simply just running the new installer on the target machine?
 
Not quite. If you need to remove and readd the reference to the project then the forms will need to be reworked. My point was that normally you wouldn't need to do any of it. Upgrading a control is simply a matter of installing and registering it unless they've made radical changes. Have you tried reverting everything to known "good" and just seeing what happens with the new control?
 
I don't understand. If I install the new control, wont I just have say... SimpleChart_2.0.DLL and SimpleChart.2.2.DLL registered on the machine, and the application still target 2.0? - In the mean time, I will try simply installing the new component
 
It depends on the control. If they kept the same COM IDs then it will be upgraded. If they broke compatibility to allow side by side usage, then you will need to delete all existing references and recreate them (maybe reverting the code), as it is a "different" control. An easy way to tell is to try adding them both to the same project.
 
3:33 PM
I can add them both at the same time. They refer to distinct entries in both the component and references list. Even the vbp file references SimpleChart3.DLL vs SimpleChart5.DLL. I tried just removing the older versions of the control from the machine, and installing just the lastest version. The app displays its splash screen then hangs indefinitely :(.... This is going to be painful.
 
If they're different controls (different name, different references, etc) then they are different, there is no automatic upgrade path
 
Hello
 
Personally, I'd remove all the controls on the forms, replace the reference at the project level, for each form, recreate the controls and give them the same name.
You can then fix up any compile errors
the code won't be deleted automatically
 
That's my plan sorta... I was hoping that I could add both references, and switch the type of the control / replace the control with the one from the new version one at at ime
 
presuming you have source control, you can diff them to see what other properties have changed
nope
you MAY be able to change the class name in the form's source
 
3:37 PM
I do have source control, so I will be able to diff
Ok, heres the plan then
ill go and screen capture the properties
for the existing controls
cache them someplace
update to the new version
recreate the controls (hopefully the logs will tell me which controls)
copy over the properties
clean up compile errors if any
give her a whirl
 
yeah
although, all the properties are text so you can easily see them in the source control diff
 
4:02 PM
Thanks Deanna, I will post a followup on my OP if youre interested in how it turns out. Thanks!
 
I'll do a fully reply shortly.
 

last day (15 days later) »