DAVSL Samples
Home Visio  DAVSL Main  This page

Installation

Simply create a directory in some convenient location, copy the Zip file there, and unzip. This should result in several subdirectories:

...\DAVSL Contains units common to any DAVSL-based VSL project.
...\otherdirs Contain various individual sample VSL projects

There are no components to install.

Project Structure

Each of the samples includes an xxx.dpr project file, which in Delphi serves to define the DLL's entry points. For a VSL this means the VisioLibMain procedure. The dpr file, as usual with any Delphi project, specifies other files to compile into the project (and this list can also be viewed in the Delphi Project Manager window).   Each project includes several files from the DAVSL directory, along with one or a few others specific to the particular VSL. A typical project looks something like this:

File category Directory Filename Description
Specific to particular VSL ...\MyVSLDir MyVSL.dpr Project file. Copy generic VSL dpr and edit the external fielname and internal library name only. (eg: Library MyVSL;)
MyVSL_AddOns.pas Unit in which to declare and implement addons. These can provide the actual functionality too, or act simply as intermediaries to othe objects/units where the real functionality happens. See the Architecture discussion. (You can have more such addon units if need be -- see how addons register themselves with the VSL object in the unit initialization sections.)
MyVSL_Control.pas Where the addons are simple intermediaries, this unit would provide the main implementation (and of course you can have any number more such units).
Common to all VSLs ...\DAVSL DAVAO.pas Translation of types and constants from VAO.h
DAVSL.pas TVSL manager object; Base TAddOn object
DAVSL_Util.pas Some supporting functions
DAVSL_About Standard About dialog
whereever Visio_TLB This is the Visio type library generated with Delphi Import Type Library feature. This should either be included in the project, or in the default Library path (such as in $(DELPHI)\Imports).  The DAVSL package includes a Visio_TLB in the ...\DAVSL directory in case you are unfamiliar with using the Import Type Lib feature.

Getting A Sample Running

To get a sample running, open one of the sample directories, and double click the dpr file, or use Delphi to open it. You may need to perform one or more of  the following steps:

Details on Individual Demos

DAVSLBeep

Trivial VSL which provides a single AddOn (function): DAVSLBeep_Beep. You can fire this AddOn using the Tools > Add-Ons menu, or create a shape with an Action which uses:

RUNADDON("DAVSLBeep_Beep")

Needless to say it sounds a "Beep-Beep" from the PC speaker. The structure of the VSL project demonstrates the minimal basics for a DAVSL-style VSL.

DAVSLColorForm

This sample demonstrates using a Delphi form as a modeless dialog to control Visio.

DAVSLShapeChange

Demonstrates supplying arguments to an AddOn (eg: using the RUNADDONWARGS ShapeSheet function). Also demos the About feature.

DAVSLArgs

Demonstrates the arguments that a VSL receives, depending on how it is called.

DAVSLEvents

Demonstrates how a VSL responds to Visio events (Connection Add and Delete).

Code notes:


Article Created: 2000-09-20  Last edit: Last edit: 00-10-30 Graham Wideman
Go to:
  DiagramAntics.com