DAVSL Technical Notes
Home Visio  DAVSL Main  This page

Some Notes

Version Applicability

This framework was built with Delphi 5, and should probably compile with Visio 4 also. It was tested with Visio 2000, and can also be used with Visio 5 so long as a Visio_TLB appropriate to Visio 5 is used, and other differences in the object model are taken into account.

Debugging Successive Revisions of Your VSL

VSL Extension: For convenience, the project options should specify a VSL extension. (This really just sets a {$E vsl} directive in the dpr file).

Output Directory: You will probably want to set the VSL project Output Directory to one of the Solution directories (preferably one established by you). With extension and output directory set as recommended here, Delphi's output is ready to test immediately after compile.

VSL Read-Only while loaded by Visio:  If you try to compile while Visio is running, Delphi won't be able to write the output file (VSL) if Visio has loaded it (and thus made it read-only for other apps.)

Debugging a DLL: In case you haven't tried it before, Delphi can debug a DLL -- you just have to specify a main executable (ie: Visio) to load. See Delphi help or docs for how-to.

Visio Caches VSL Info: Visio normally caches info about all the VSLs and their AddOns (otherwise Visio would have to load and perform ENUMADDONS on every VSL at every start-up). In theory, when Visio starts up it inspects all of the Solutions directories to see if there's anything new,and if so loads only those VSLs to discover their AddOns. For normal user purposes this works fine. However there are some developer situations where the cache doesn't seem to update when it should, which can lead to having ShapeSheet RUNADDON functions doing nothing

Further, I noted that if on successive compiles you change the HASABOUT or HASHELP attributes, Visio doesn't seem to recognize his unless you delete the VSL entirely, force a cache update (Tools > Addons) so that Visio forgets the VSL, then reinstate the VSL.

Arguments Supplied to a VSL

When Visio calls a VSL, it supplies several arguments which vary according to the context in which the VSL is called, in addition to passing any arguments explicitly supplied in, say, RUNADDONWARGS, or AccelItem.AddOnArgs. These are described in DVS, but I've tabulated them here for easy comparison.

Context doc page/master other additional
Tools > Add-Ons - - - -
Run on launch - - launch -
UI Item (eg: AccelItem) - - - AddOnArgs
RUNADDON... RUNADDONWARGS...
In Shape cell: doc=N page=N shape=Sheet.ID myarg=myval etc
In Master doc=N master=N shape=Sheet.ID myarg=myval etc
In Style doc=N - style=NameID myarg=myval etc

DAVSL's argument parser presents the argument list in a convenient TStringList, where you can use TStringList's various functions for obtaining the keyword or value or each pair. In addition, the parser:


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