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?
"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."
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With