Visio 2003 and 2007 Compatibility

E

EliA

Hi all,

I'm developing an application in C# (Visual Studio 2005) using Visio
Active-X drawing control.
I've started the development using visio 2003 and it all worked fine,
but when I tried to run the application on a machine with visio 2007
installed on it, some problems occurred:

- All event handlers of the visio control are not registered (e.g.
mouse clicks behavior is the default one and not the one I've
created).

- The new feature of AutoConnect is enabled (and I cannot disable it
if I compile my code with the 2003 version).

Also, I cannot compile my code on a machine with visio 2007 unless I
change the project references.

Is there any way to make my application work with both versions of
visio?

Thanks in advance,
Eli.
 
A

AlEdlund

For a start if the application has to run on both systems, you should not
call anything that is unique to v2007 since it will not be available on the
v2003 systems. Some of this can can be handled with conditional compiles and
having your application check for what platform it is running on. Different
libraries for platforms are often a fact of life in development, another
reason for the neeed for conditional compiles. If you want to develop for
both platforms it would be advisable to have both versions installed on the
same system to ease the process.
al
 
E

EliA

Hi Al,

Thanks for the quick reply!

Can you please be more specific about conditional compiles?

How can I assure that the project references and events will work on
both versions?

Thanks again,
Eli.
 
A

AlEdlund

Conditional compiles allow the developer to set tags at the beginning of
code that will allow the compiler to select what has to be acted upon. You
might check this out

http://blogs.msdn.com/andreww/archi...e-add-in-for-multiple-versions-of-office.aspx

short answer, if it works in v2003 it will probably work in v2007- but you
still have to test. As part of testing don't forget the impact of different
service packs having been made available for each platform.

al
 
B

BrunoV

Hi Eli and Al,

I'm in the same situation with an application originally developed with
Visio 2003 that we're adapting for Visio 2007.

I'm developing on a computer with XP SP2 where Visio 2007 (+SP1) has been
installed. I've updated all references of my projects to point to the new

Visio libraries and the solution compiled without any problem.

But since, when i'm debugging, the application never reaches the code of my
handlers, although they seem correctly registered during the form

initialization.

Do one of you have a solution to this issue ?


BrunoV
 
A

AlEdlund

A couple of questions. Is it a ComAdd(in/on) or WinForms application? Have
you attempted to use the event monitor tool to see if events unique to your
application are firing? Anything in the event logs? If a Com app is it
showing as registered in Visio?
al
 
B

BrunoV

Actually, it's a WinForms app in C# (.NET Framework 1.1 ; Visual Studio 2003).

I checked the system event log but saw nothing about Visio or our application.

I followed your advice and used the Visio event monitor : i can see that
mouseDown and mouseUp events are fired when i click inside the drawing
control.

To be more specific, the problem is that we want to prevent the Visio
right-click menu from appearing and to replace it by one of our own. It works
with Visio 2003, but with Visio 2007, it's the classical Visio menu that
appears when doing a right-click in the drawing control.
 
A

AlEdlund

It's been awhile, but, as I remember the solution used to be add the right
mouse click event to the list of event handlers being handled by addadvise.
This used to take away the internal handler and give it over to the
developer so they could then use marker events to call their custom code.
al
 

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