Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do development and build in visual basic 6.0

Tags:

vb6

I am looking for best practice in building multiple visual basic projects(all dll's).We have multiple projects, and our final deliverable will be a dll.Now, one project uses 2 other projects, and another refers to another project.Should projects reference the vbp files, or the dll? If they reference vbp files, how to build all the projects?

like image 659
ravi Avatar asked Dec 18 '08 17:12

ravi


People also ask

What are the three steps for building an application in Visual Basic?

"When you write a Visual Basic application, you follow a three-step process for planning the project and then repeat the process for creating the project. The three steps involve setting up the user interface, defining the properties, and then creating the code."


2 Answers

After some years with VB6, our projects tended to be structured like this:

All project source (project and source) organized under the source folder.

\project\source
\project\source\project1\
\project\source\project2\
...

All binaries (.dll and .exe) in one bin folder.

\project\bin\

All .dll set as binary compatible with resulting file in the single bin diretory.

After initial build to make the binarycomptible stable, every non breaking build would be done by using a simple command file build.cmd placed in the folder above the source folder, maybe like this:

"c:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE" /M .\source\project1\proj1.vbp
"c:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE" /M .\source\project2\proj2.vbp
"c:\Program Files\Microsoft Visual Studio\VB98\VB6.EXE" /M .\source\project3\proj3.vbp
del .\\bin\\*.exp
del .\\bin\\*.lib

The build order must be in the order of dependance.

Whenever a breaking change occured, the dependant VB project must be refrenced to the new binary.

Without breaking changes, the build.cmd usually did the job.

like image 191
Kb. Avatar answered Oct 30 '22 07:10

Kb.


Unless you are specifically managing the type libraries externally from VB, you should use project references. If you reference the files, and you modify the public interface in various ways VB will generate new id's for various pieces in the typelibrary which will result in type mismatch errors.

You can use the Preserve Compatability settings to help alleviate this. Make sure your using at least project level (If your doing COM+ then you'll want binary the one based on an already compiled version of the dll)

As for compiling, you can compile a solution file (been a long time since I even had Vb6 installed but I think they were .vbg files).

Back in the day we used Visual Build, and also Visual Make which supported compiling the solution files.

like image 26
JoshBerke Avatar answered Oct 30 '22 07:10

JoshBerke