System.InvalidCastException

W

Wes Lowe

I'm currently having a problem with an InvalidCastException in this piece of
C# code :

foreach(Visio.Shape curShape in
axDrawingControl1.Document.Application.ActivePage.Shapes)

Obviously this shouldn't be occuring.
This code is called after a Proccess.Exited event has fired.
If, rather than using this event I just add a timer to wait 10 seconds for
this process to finish and then call the same piece of code, it works fine
and gives no exception.
I'm guessing this is probably more of a C# or Visual Studio problem but I
thought I'd post here anyway to see if anyone has come across this.

Any help is appreciated.

Wes
 

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