Link to home
Start Free TrialLog in
Avatar of weiroblpay
weiroblpayFlag for United States of America

asked on

How do I develop the same VB6 app from different computers without getting missing OCX or DLL errors?

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:
Object={27F22AE7-75C1-4413-A7E2-8536E6C04D5B}#1.0#0; lvButton_H.ocx
The value in the brackets is different after I've re-selected it - looks like this:
Object={6E42274A-EF84-4B2B-82FB-5B2598CF6A39}#1.0#0; lvButton_H.ocx

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)?

Thanks,

Ron
Avatar of vinnyd79
vinnyd79

You could create a setup application using the P&D wizard or another setup program such as inno setup. This way the setup program can include the ocx files as well as register them. You could also add your ocx/dll files to your system directory and then register them using:

regsvr32 Somefile.ocx
Need to set binary compatibility on the OCX and DLL components.  What's happening is each time you compile without binary compatibility, your OCX and DLL components are assigned new IDs in the registry.  Let's say you compile at work.  The source code is updated to point to these new IDs, but those IDs don't yet exist in the registry on your home computer, so when you open your project at home, you get the "MISSING" etc.  If you manually registered (using regsvr32) your OCX's and DLL's prior to opening your project, it should work fine.  But the best answer is binary compatibility, which "locks" the IDs so the same ones are used each time you compile.  (Note, binary compatibility also requires that you don't change or remove any public members of your component interface, so if you're making a lot of changes to the OCX's and DLL's go with the manual registration idea instead).
Avatar of weiroblpay

ASKER

Thanks for your replies, but I guess I need to clarify.

My problem is because I'm editing the source code on 2 different computers. The source code references a Third Party OCX or DLL; not one that is being developed in my application. I can't use the binary compatibility (or any other compatibility option) because the DLL or OCX that I'm having trouble with is one that I select in the Project: Components menu.
The acutal OCX or DLL file is a complied component to which I don't have source code access. It's just another reference in my application, like the Microsoft Windows Common Controls (MSCOMCTL.OCX). I have full rights to use the OCX file and develop and distribute it, but no source code.

I use INNO setup and if I compile and create a setup and run that on another system, everything works fine. It's just while developing that I have the problem. The third party OCX that I have problems with is registered properly on all computers that I use, but not always in the same folder on each one.

Does that help?  I need to be able to copy my source code from one computer to another and continue developing it without always getting errors because VB can't seem to find the location of the third party OCX file that's included as a component in my project, even though it's registered properly. I'm pretty sure it has something to do with the CLSID entries in the registry, and/or the actual physical path to the OCX file, but I haven't figured out yet how to resolve that.

Thanks,

Ron
SOLUTION
Avatar of dancebert
dancebert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So this is just a 'known' problem the Microsoft never addressed?

I thought there may be a much better solution rather than an ugly brute force or kludge type solution. Any other possibilities?

>So this is just a 'known' problem the Microsoft never addressed?
No clue.  Could be that it was too difficult to reproduce.  

I don't know of any other ways to fix the problem.
ASKER CERTIFIED SOLUTION
Avatar of glass_cookie
glass_cookie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks dancebert and  glass_cookie.
I'll try this out and come back...
Hi.

The problem is then its been installed the 3rd party ocx on diferent computers but diferent minor versions, and on diferent paths.

there are two solucions i can tell
1st
   if you open your .vbp file with a text editor you can find at the begining declarations of what components are registered on it, just find de one with problems and replace the key and path to the corresonding on the pc you want to develop.

   the next lines are an example of a vbp file opened with notepad  (

  Type=Exe
  Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\WINDOWS\System32\STDOLE2.TLB#OLE Automation
  Reference=*\G{3B008041-905A-11D1-B4AE-444553540000}#1.0#0#..\..\Program Files\Rational\common\vsocx6.ocx#:-) VideoSoft vsOcx6 Controls
  Form=Sample.frm
  Startup="Form1"
  Command32=""
  Name="Project1"
  HelpContextID="0"
  )

  The second line started with reference shows the key and path of the 3rd party file "Video vsOcx6 Controls"

2nd
  Reinstall same minor version in same path in all PCs.

Luck
Thanks for the help.