System.Runtime.InteropServices.COMException (0x86DB0898)

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
 
D

David Parker

Does you EventSink class have the COMVisible tag?
Eg
<ComVisible(True)> _
Public Class EventSink
Implements IVisEventProc
 
W

WPfeffer

I came in this morning and thought that I would try your suggestion. Before I
did however, I rebuilt the project, reinstalled, and now everything works
again. I'm not sure what happened and why it works now and it didn't before,
but if it stops working again, I will try your suggestion.

Thanks for the help.

Wayne

David Parker said:
Does you EventSink class have the COMVisible tag?
Eg
<ComVisible(True)> _
Public Class EventSink
Implements IVisEventProc

--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com
WPfeffer said:
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
 
Y

Young Hee Choi

Check if EventSink class is defined as public..

WPfeffer said:
I came in this morning and thought that I would try your suggestion. Before
I
did however, I rebuilt the project, reinstalled, and now everything works
again. I'm not sure what happened and why it works now and it didn't
before,
but if it stops working again, I will try your suggestion.

Thanks for the help.

Wayne

David Parker said:
Does you EventSink class have the COMVisible tag?
Eg
<ComVisible(True)> _
Public Class EventSink
Implements IVisEventProc

--
David Parker
Microsoft MVP (Visio)
http://bvisual.spaces.live.com
http://www.visualizinginformation.com
WPfeffer said:
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
 

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

Similar Threads


Top