Error in using EventSink Class

A

Asif

We are using Visio 2003 Active X drawing control in our application
that uses EventSink class for capturing shape connects events. We are
creating the instance of EventSink class and our operations at
DocumentOpened event of Visio Drawing Control.

This works fine with Visio 2003 Control but if we replace the control
with Visio 2007 drawing control and when going to open any drawing
file by setting control Src property to file name, control throws an
exception with the following message:

A first chance exception of type 'System.NullReferenceException'
occurred in axinterop.microsoft.office.interop.visocx.dll

Additional information: Object reference not set to an instance of an
object.

If EventSink code is commented this error will not occur and file
opens normally.

Can anyone help about how to solve the issue?

Thanks

Asif
 
G

Gshell

Are you opening a TEMPLATE or a DOCUMENT?

If you are opening a template see the new thread I am adding about an issue
with template files and the VISIO 2007 drawing control.

Gary
 
A

Asif

I am opening drawing file which activates DocumentOpened event of
Visio Drawing Control.
 
G

Gshell

Does this actually occur on the line of code where you set the SRC property
or further along?

Gary
 
A

Asif

Does this actually occur on the line of code where you set the SRC property
or further along?

Gary






- Show quoted text -

When ever Drawing Control src property changes by assigning drawing
file name to it, VisioControl_DocumentOpened event fires which
contains EventSink code and throws exception "Object reference not set
to an instance of an
object."
 

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