![]() |
Visio 2002 Developer's Survival Pack Tools and Samples |
Notes on Visual Basic Samples | |
![]() ![]() |
A number of general points are worth covering in connection with the several Visual Basic samples. (These notes do not apply to the VBA code in the numerous Visio documents.)
Several samples involve an executable (Exe), or a DLL which implements an ActiveX VBVSL. Provided with each sample is source code, and also the compiled executable or DLL. These might appear to be "ready to run". However, bear in mind that Exes and VSLs produced by Visual Basic depend upon other VB-supplied modules, notably the VB Runtime libraries. If you already have Visual Basic 6 installed, then these will be present on your machine, and thus available to the provided Exe or DLL. If you do not have VB6 installed, these compiled samples will likely not run in any useful way.
To run the samples on a machine that lacks a VB6 installation (or to deploy them to users who likely won't have VB6 installed), you would need to follow the usual procedure for deploying VB-based applications: On a machine equipped with Visual Basic you would compile the source code and then use the Package and Deployment features of Visual Basic to create and installation kit that can be deployed.
You can inspect the source code files regardless of whether you have Visual Basic installed, but using a text editor. However, you will most likely want to inspect and perhaps modify and compile the sample code, of course using the Visual Basic development environment. To do this, simply use the VB environment to open one or another of the "project" files (something.vbp).
This should proceed smoothly, except for one minor hitch. Several of the projects employ "references" to one or another type libraries. It is these references which permit a VB project to know how to call some other functionality or service, such as a particular ActiveX component or some operating system services. Unfortunately, the references as supplied in my project files may or may not find the corresponding components on your system, as they include file paths that may nor correspond to where the component is located on your machine.
So, for any particular VB sample, it would be a good idea to inspect the vbp file (eg: in Notepad), and make a note of the references that are listed. Later, when you open the project in VB, visit the Project > References dialog and make sure that these references are indeed hooked up properly.
Article Created: 2001-06-01 Last edit: Last edit: 01-07-04 Graham Wideman
Go to: DiagramAntics.com