How do I develop the same VB6 app from different computers without getting missing OCX or DLL errors?
Posted on 2006-03-27
I develop applications from different computers. One is at work, one is at home and a laptop while on the road. All of them have the same version of VB6 Professional installed with the same service pack (sp6). All development computers are Windows XP SP2 desktops / laptops.
I don't have access to a central source code control application (on the internet?), but if that would help, I would look into it.
Typically I work on an application at home, then transfer all of the files to a USB disk and copy them to a folder at work. The problem I have is when I open the project file in VB6 IDE, it gives me an error like this:
C:\Data\programming\source\vadvocate\lvButton.ocx could not be loaded.
Then I get an error log file for every form that has the OCX file on it. The buttons (in this case) are changed to picture boxes and the OCX file is no longer referenced as a component. The error looks like this:
Line 55: Class lvButton_H.lvButtons_H of control btnClose was not a loaded control class.
I also sometimes get an error in the References box where it shows some DLL or control as MISSING:....
Note: This does not happen with the included VB controls and referenced Microsoft DLLs and OCX files - only with third party DLLs or OCX files.
The OCX file has never been located in the folder with the application source, but in a different place. I believe the problem may be related to the registered OCX file being in different places on the different developer computers.
I can usually resolve the problem in one of 2 ways. 1): Go to Project:Components and select the OCX file and then replace all of the picture boxes with the component, then re-save the project (VERY time consuming) 2: Go to Project:Components and select the OCX file; open 1 form and put a new control (button in this case) on the form, then close it. Close the project and make sure that I ONLY save the VBP file, not the changed form.
This seems to work, but is clunky at best and takes a lot of time. When I select the control in the Components dialog box, it's still shown there, but is not checked. The control is referenced in the VBP file as:
The value in the brackets is different after I've re-selected it - looks like this:
I would like to know if there is a better way to do this. How do I avoid this issue when developing the same application on two or more computers? In other words, what is the best way to do this (without access to a central server / repository that holds all of the source code files and components)?