W
WPfeffer
I have another mess that I haven't found an answer for and maybe one of you
wonderful people out there can help. It's actually quite simple what I'm
trying to do, I just want to add the 'MarkerEvent'
((short)VisEventCodes.visEvtApp + (short)VisEventCodes.visEvtMarker) to
AddAdvise. My code:
public void OnConnection(object application,
Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array
custom)
{
vsoApplication =
(Microsoft.Office.Interop.Visio.Application)application;
addInInstance = addInInst;
EventList applicationEventList = vsoApplication.EventList;
try
{
markerEvent = applicationEventList.AddAdvise(MarkerEvent,
applicationEventSink, "", "");
}
catch (COMException e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
vsoApplication.Documents.OpenEx(@"C:\Documents and
Settings\wep85069\My Documents\VisionBots.vst",
(short)VisOpenSaveArgs.visOpenCopy);
}
The error:
System.Runtime.InteropServices.COMException (0x86DB0898)
The error is thrown at the:
markerEvent = applicationEventList.AddAdvise(MarkerEvent,
applicationEventSink, "", "");
line.
Any help or suggestions would be greatly appreciated. I have tried adding
the [COMVisible (true)] attribute above the 'public void OnConnection ....'
definition, but I still get the same error. I also have the 'Make assembly
COM-Visible' check box checked in the 'Assembly Information' dialog part of
the project settings.
Thank you.
Wayne E. Pfeffer
wonderful people out there can help. It's actually quite simple what I'm
trying to do, I just want to add the 'MarkerEvent'
((short)VisEventCodes.visEvtApp + (short)VisEventCodes.visEvtMarker) to
AddAdvise. My code:
public void OnConnection(object application,
Extensibility.ext_ConnectMode connectMode, object addInInst, ref System.Array
custom)
{
vsoApplication =
(Microsoft.Office.Interop.Visio.Application)application;
addInInstance = addInInst;
EventList applicationEventList = vsoApplication.EventList;
try
{
markerEvent = applicationEventList.AddAdvise(MarkerEvent,
applicationEventSink, "", "");
}
catch (COMException e)
{
System.Windows.Forms.MessageBox.Show(e.ToString());
}
vsoApplication.Documents.OpenEx(@"C:\Documents and
Settings\wep85069\My Documents\VisionBots.vst",
(short)VisOpenSaveArgs.visOpenCopy);
}
The error:
System.Runtime.InteropServices.COMException (0x86DB0898)
The error is thrown at the:
markerEvent = applicationEventList.AddAdvise(MarkerEvent,
applicationEventSink, "", "");
line.
Any help or suggestions would be greatly appreciated. I have tried adding
the [COMVisible (true)] attribute above the 'public void OnConnection ....'
definition, but I still get the same error. I also have the 'Make assembly
COM-Visible' check box checked in the 'Assembly Information' dialog part of
the project settings.
Thank you.
Wayne E. Pfeffer