Problem with Visio 2003 and 2007 Drawing Control

M

Marx

Hello,

I've installed Visio 2007 with the option to leave previous versions
installed i.e. not to upgrade but to run both versions side-by-side.

I have a project referencing the Visio 2003 (version 11) drawing control.
Without making any changes after the 2007 install, I build the project. The
project still indicates version 1.0 of the VisOcx.dll guid
HKEY_CLASSES_ROOT\TypeLib\{F1A8DFE4-BC61-48BA-AFDA-96DF10247AF0} not 1.1 as
for version 12.

The wrapper AxInterop.VisOcx.dll in the bin\release directory is now version
12 instead of 11.

Is there a fix for this?

Thanks for any ideas.

M
 
A

AlEdlund

v2003 and v2007 use different libraries (thus different references in the
project definitions). Are you going to have two different projects based on
the target installations? Visual Studio isn't smart enough to figure that
out, so you have to.
al
 
M

Marx

Thanks Al,

I think you misunderstood. I do plan to have two projects - one for each
version.

I'm saying that I have made no changes to the v2003 project (All references
point to 2003 Interops) and so I expect the AxInterop.VisOcx.dll in the
bin\release directory (and obj\release) to remain v2003 after building. It
does not. Even though the project references indicate v2003(11), the
AxInterop.VisOcx.dll added to the bin\release folder is v2007(12).

The question is: How do I make sure Visual Studio 2005 still adds a v2003
AxInterop.VisOcx.dll and not a v2005 dll after installing Visio 2007 (using
the option to keep older versions NOT upgrade) on the same machine as Visio
2003?

Thanks,

M
 
M

Marx

Thanks Christian,

I guess that part was easy enough. On the other hand:

1) Right-click toolbox /Choose Items../COM Components tab, only version 12
is displayed by Visual Studio.
2) The events no longer work with Visio 2007 installed e.g.
axDrawingControl1_SelectionChanged does not fire.
3) In Solution Explorer Microsoft.Office.Interop.Visio,
Microsoft.Office.Interop.VisOcx and AxInterop.VisOcx all refer to version 11.
Still Visual Studio still includes Microsoft.Office.Interop.Visio version 12
in the compiled EXE. When the exe is then moved to a machine without Visio
2007 installed an exception occurs with a message similar to "Can't find
Microsoft.Office.Interop.Visio Version 12 publicKey etc".

To get the EXE to work on a machine that does not have Visio 2007 installed:
i) Run Ildasm to an output file
ii) Remove references to Microsoft.Office.Interop.Visio Version 12
iii) Run Ilasm to recreate the EXE file.

This works on a machine that does not have Visio 2007 installed. Even the
events work.

I think the conclusion is: "Use separate development machines for each
control." Unless anyone knows a better way.

Thanks,

M.
 
M

Marx

You were right. Microsoft.Office.Interop.Visio and
Microsoft.Office.Interop.VisOcx were pointing to version 12 even thought the
description said 11. So all three Interops not just AxInterop.VisOcx have to
be referenced from local files. Now the 2003 build works fine on a different
machine not having 2007 installed.

On the build machine though with 2007 also installed the events for the 2003
component do not work. Others have experienced this apparently see
http://www.eggheadcafe.com/software/aspnet/29452487/visio-2003-control--stra.aspx

Does your App require events e.g. axDrawingControl1_SelectionChanged?
 

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