Reference to Visio libraries

G

Gary Shell

I have an Access app that generates Visio diagrams. I have Visio 2003 on my
development machine and set a reference in the Access app to the VISIO 2003
library.

When I moved the app to a machine with VISIO 2000 I got errors because of
the reference to the non-existent Visio 2003 libraries on the test machine.
If I changed the reference to the VISIO 2000 library everything worked fine.

My question is how to set up the reference so that when I deploy the app it
is able to determine the environment it finds itself in and change
accordingly.

Gary
 
J

Jon Summers

Gary ...
I have an Access app that generates Visio diagrams. I have Visio 2003
on my development machine and set a reference in the Access app to the
VISIO 2003 library.
When I moved the app to a machine with VISIO 2000 I got errors because
of the reference to the non-existent Visio 2003 libraries on the test
machine.
If I changed the reference to the VISIO 2000 library everything worked
fine.

Each library version has a version ID. If you're developing on Visio 2003
then you can't expect Visio 2000 to provide the same functionality, and
the version IDs don't match. The inability of your app. to find Visio
libs on a computer that doesn't have the product installed is a way to
safeguard your app.

You must develop to the least-common-denominator of your clients: Visio
2000. If you develop using Visio 2000 then it will be able to use either
Visio 2000 or Visio 2003 on a client computer.
 
G

Gary Shell

The application works fine with either Visio 2000 or Visio 2003, that's not
the issue. The issue is when I move the app to a Visio 2000 machine, it
dies on the first library reference, in this case a simple Left$ function.
This, of course, is a sure sign of a missing reference. Going to the
references tool in a module window confirms that the Visio 2003 library is
missing. Changing the reference, manually, to the old Visio 200 library
allows the application to run just fine.

So I am back to the original question, if these version ID's are different,
as they obviously are, how does one create an app that can at runtime or
even install time, cope with the fact that different users are going to have
Visio 2000 or Visio 2003? I am not sure I understands how developing under
Visio 2000 is going to be any different. If the version ID's are different
am I not going to have the same issue when someone installs the app on a
Visio 2003 machine?

Gary
 
G

Gary Shell

In an Access newsgroup it was suggested that I try late binding (via
CreateObject) instead of early binding (via the Reference) as a solution to
this issue. I will try that and report back.

Gary
 
J

Jon Summers

Gary ...
I am not sure I understands how developing under Visio 2000

Because of the Laws of COM. When you write an application that uses
V2000, your code expects to find the specified set of objects, methods and
properties that are defined in the Visio interface.

V2003 is bound, by the Laws of COM, to provide the same interface as its
predecessors. Code written to the V2000 interface will work with the
V2003 interface. However, the V2003 will have additional functionality
that is not in the V2000 interface (otherwise, would there be any point in
creating a new version?). If you write code using the V2003 interface,
there's no guarantee that any given object, method or property will exist
in the earlier interface.
 
G

Gary Shell

Jon,

Thanks for the brief COM lesson, but I already know that much. I've been
using VB since version 1. (Actually an early beta). All my COM
deployments, though, never relied on a third party DLL, like this so I have
thankfully never had a deployment issue like this. Either I am not making
myself clear or you are not reading my entire messages. Most likely the
former. <grin>

This is not a case of my using features in Visio 2003 that are not present
in Visio 2000.

The development machine started out having Visio 2000 on it. The app was
developed under Visio 2000. Latter I upgraded the development machine to
Visio 2003 and I tested the app which worked just fine under 2003. Then I
took the newly tested app over to a test machine which still had Visio 2000
on it. I got an error on the first library reference. (In this case a
simple Left$ function.) This of course is an indication that some reference
is missing. Sure enough, I went to the references and noticed the Visio
library reference was marked as missing. (Which makes PERFECT sense as it
referred to the VISIO 2003 library.) As soon as I created a reference to
the older Visio 2000 library the app ran fine.

So my dilemma is how can I deploy the app, to an audience of users some of
whom will have Visio 2000 and others will have Visio 2003? One suggestion I
received was to use late binding instead or a reference (or early binding).
That makes sense and will probably be what I have to do. But that means
either I have no "intellesense" while developing OR I change to late binding
when I create a production version of the app.

I was hoping for something a little more "automated": Am I any clearer this
time??
 
K

K. Kazinski

Hi Gary

In your references place the Visio 2000 library after the Visio 2003 library. This way when the missing reference to V2003 is there the reference to the V2000 DLL's will catch the references

Hope that helps

Ke
 
J

Jon Summers

Gary ...
you are not reading my entire messages

Possibly ...

It may be that your Visio 2000/2003 issues are a red herring. I think
that Left$ is part of VBE, and it may be that the V2000 is using a
different VBE library to V2003.

I've seen this problem in another's vendors VBA. The solution was to
re-reference the right VB/VBE lib. Anyway, it hilights the issue of DLL
Hell.
 
G

Gary Shell

Jon,

The VISIO issue is NOT a red herring, It IS the problem. As I stated all I
have to do is fix the reference to the VISIO library on the test machine and
the app runs just fine. I'll repeat the question one last time. How does
one deploy an application that references the VISIO 2000 to a user community
that has a mixture of VISIO 2000 and VISIO 2003.

I don't want to sound rude here, but either read my entire replies or don't
bother replying.

Gary
 
G

Gary Shell

Interesting idea. But in order to create the two references, I would have
to have Visio 2000 and Visio 2003 on the development machine. I guess that
is do-able but I have never tried having both present. I had no idea it was
possible to have references to multiple versions of the same library in the
same project. Have you actually done that before?

Cool idea, thanks!

Gary


K. Kazinski said:
Hi Gary,

In your references place the Visio 2000 library after the Visio 2003
library. This way when the missing reference to V2003 is there the
reference to the V2000 DLL's will catch the references.
 
J

Jerry

Gary, I understand your problem and agree with the late binding solution. Since you already have most of your code perfected using intell-sence... The issue realy is to determine which verions of visio is present on the machine and then use late binding to create your visio applicaion object. Since I'm not a visio programer I'm not much help.

I'm looking to use vision object in my .net projects. Do you know anything about if there are yet any .net visio interfaces or do I still need to you visio uisng com-interop?

Jerry
 
G

Gary Shell

Sorry, no I don't know. I have not done any Visio and .Net work just yet.

Gary


Jerry said:
Gary, I understand your problem and agree with the late binding solution.
Since you already have most of your code perfected using intell-sence...
The issue realy is to determine which verions of visio is present on the
machine and then use late binding to create your visio applicaion object.
Since I'm not a visio programer I'm not much help.
I'm looking to use vision object in my .net projects. Do you know anything
about if there are yet any .net visio interfaces or do I still need to you
visio uisng com-interop?
 
K

K. Kazinski

Hi Gary,

Yes I have used this idea before with ADO. I have tow references to ADO and the first one is more current than the second.

The library names for Vision 2003 & 2000 are different. You will need to get the libraries from the other machine and place it on your machine. I would suggest putting it with the project and not in your windows directory.

Ken


----- Gary Shell wrote: -----

Interesting idea. But in order to create the two references, I would have
to have Visio 2000 and Visio 2003 on the development machine. I guess that
is do-able but I have never tried having both present. I had no idea it was
possible to have references to multiple versions of the same library in the
same project. Have you actually done that before?

Cool idea, thanks!

Gary


K. Kazinski said:
library. This way when the missing reference to V2003 is there the
reference to the V2000 DLL's will catch the references.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top