J
Josef Meile
Hi,
I'm trying to catch the MouseUp event from a C# visio addon like this:
const short visEvtAdd = -32768;
Visio.EventList eventsDocument;
try
{
eventsDocument = VisioDocument.EventList;
eventsDocument.AddAdvise(
(short)Visio.VisEventCodes.visEvtCodeMouseUp,
CExeAddon.EventHandler, "", "");
}
catch (Exception err)
{
System.Diagnostics.Debug.WriteLine(err.Message);
}
But I got an unclear error that says me nothing:
Message: An exception occurred.
Exception Type:System.Runtime.InteropServices.COMException
StackTrace:
at Microsoft.Office.Interop.Visio.EventListClass.AddAdvise(Int16
EventCode, Object SinkIUnkOrIDisp, String IIDSink, String TargetArgs)
at EVA.CApplication.AssociateEvents() in c:\\addon\\capplication.cs:line
152"
I catched other events successfully by changing the event codes and it had
worked. Only the MouseUp event gives me problems.
Ah, if you are wondering how my EventSink class looks like, it is the same
one included with the SDK examples.
Does anybody know what the problem could be?
Regards,
Josef
I'm trying to catch the MouseUp event from a C# visio addon like this:
const short visEvtAdd = -32768;
Visio.EventList eventsDocument;
try
{
eventsDocument = VisioDocument.EventList;
eventsDocument.AddAdvise(
(short)Visio.VisEventCodes.visEvtCodeMouseUp,
CExeAddon.EventHandler, "", "");
}
catch (Exception err)
{
System.Diagnostics.Debug.WriteLine(err.Message);
}
But I got an unclear error that says me nothing:
Message: An exception occurred.
Exception Type:System.Runtime.InteropServices.COMException
StackTrace:
at Microsoft.Office.Interop.Visio.EventListClass.AddAdvise(Int16
EventCode, Object SinkIUnkOrIDisp, String IIDSink, String TargetArgs)
at EVA.CApplication.AssociateEvents() in c:\\addon\\capplication.cs:line
152"
I catched other events successfully by changing the event codes and it had
worked. Only the MouseUp event gives me problems.
Ah, if you are wondering how my EventSink class looks like, it is the same
one included with the SDK examples.
Does anybody know what the problem could be?
Regards,
Josef