Two Visio-AxDrawingControl Objects Conflict

H

ha1o

Hi. I need help with this new problem

In my application, I am using the AxDrawingControl class in a winForm to
draw circuits. Now the complexity of my application has grown. I added new
winForm with another AxDrawingControl object; because I needed a completely
different function thatn the first one.

here is how i'm working, the application loads the main form. the user can
switch between the winForms without losing information, I don't dispose
anything. When the user switch to the second window with the new
AxDrawingControl object and try to open a visio File, the application throws
an error that says "Object reference not set to an instances of an object".
If the user keeps trying to open the file, there is a moment when the error
does not show more, but the file gets opened if the other windows on the
first AxDrawingControl object.

Also, If I debug the program, I can see that the "Documents" property of the
second AxDrawingControl object already have opened all the stencil files I
opened in the first one. It looks like the files I open in one
AxDrawingControl object can be fully accessed by the other AxDrawingControl
object; so why the second object does not show the files on the ShapeSearch
window?

I check my code, and I was careful about the full name of the code,
"this.va1.docs" things like those.

Resuming, I don't know how to manage stencils and/or visio files between two
AxDrawingControl objects. Can you give me a hand with this problem?

Thanks.
 
A

Al Edlund

the thing to remember is that when using visio activex controls in an
application is that only a single instance of visio is started, and a single
document is open in each control. You have to keep track of which document
is being worked on (at least that was what I ran into).
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