How to share a VB project with another programmer overcoming the vbp "link" problem?

I have this old VB6 project, which consists of several DLLs, OCX and GUI.

There is a GUI component that includes this VBP file:

Type=Exe Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#C:\Windows\SysWOW64\stdole2.tlb#OLE Automation Object={EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0; ieframe.dll Object={3050F1C5-98B5-11CF-BB82-00AA00BDCE0B}#4.0#0; mshtml.tlb Reference=*\G{64E54C86-D847-48F7-9AE5-D6C9B8E6A3A2}#3.0#0#..\..\bin\Crypt.dll#Crypt Reference=*\G{B3E7F95C-B6D9-458E-B4D4-5272759B139A}#4.0#0#..\..\bin\SpeechMike.dll#SpeechMike_DLL Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.1#0; MSCOMCTL.OCX Object={AB4F6C60-4898-11D2-9692-204C4F4F5020}#29.0#0; Ccrpsld.ocx Object={48E59290-9880-11CF-9754-00AA00C00908}#1.0#0; msinet.ocx Object={9C526969-AA6E-4D61-BAFA-117FD20C2B38}#3.0#0; SpeechMike.ocx 

Link settings are a pain, as they always change from one machine to another. I mean, the GUID '9C526969-AA6E-4D61-BAFA-117FD20C2B38', for the latter as an example, will be something on my system, but something else on some other machine.

Now, to make it work, I delete the links to Crypt.dll and SpeechMike.dll. Also Object SpeechMike.ocx. Otherwise, Visual Studio is looking for something that does not exist. Then in the "project> links" I check Crypt and SpeechMike, and Reference returns to VBP with the corresponding GUID and version. Finally, in the "project>" components, I add OCX, and I'm good to go.

Am I really wrong? How can I share a project with some other without going through hoops and loops to start a project?

I am using MS Visual Basic 6 (part of the VS 6 enterprise).

+4
source share
1 answer

It sounds like a failure to maintain binary compatibility. Usually you do this only for yourself, but, of course, it can be a big headache if several people collect your libraries from Project source files.

When creating EXE files for ActiveX, DLL and OCX, you need to create a "base" version in which the type and class identifier (GUID) will be assigned. The documentation even assumes that you do this by leaving the procedures empty: just a comment line or something else, so the IDE does not delete empty declarations.

You do not need to use the "empty" base reference library, it can be one with the full code.

Once you have compiled this base library, you exit and save the project. Then rename this "empty" library as something else and from there save it along with the source files of the project.

After that, you will open the project again and go to "Project Properties", and on the "Component" tab, change the "Compatibility" parameter to "Binary Compatibility", and enter the full path and name of your compiled base library in the field. Save the project. Now you can add code and compile a β€œreal” library that will be used by other programs.

When you distribute these libraries (DLL, OCX) to someone else in the form of source code so that they can compile them, you must provide this renamed compiled base library along with the source code files, VBP file, resource files, etc.

From there, your GUIDs will be stable until you contribute something that breaks binary compatibility (changing the list of method arguments, etc.).

This is described in detail in the online help (MSDN Library). Cm:

Using Visual Basic | Component Tool Guide | Creating ActiveX Components | Debugging, Testing, and Deploying Components | Version Compatibility in ActiveX Components

+9
source

All Articles