COM interoperatability using PInvoke (SEH Exception)

  • Thread starter Thread starter Muthiah Samy
  • Start date Start date
M

Muthiah Samy

Hi All,

I am trying to call COM Component in .NET using PInvoke.
I have rewritten custom IDL file in a managed language(C#).
When I try to invoke one of the COM method from .NET, I am getting the
following exception.

System.Runtime.InteropServices.SEHException: External component has
thrown an exception.

What could be the reason to get this kind exeception, I don't know
what to do in order to handle it error. Could anyone kindly help me to
solve ? I will greatly appreciate.

Thanks & Regards
R. Muthiah Samy
 
Muthiah,

That is hard to say without knowing the original IDL, as well as your
managed implementation. It is completely possible that the COM component
has a bug as well. However, to be sure, you should make sure that you are
marshaling everything correctly.

Can you post the original IDL definition of the interface, as well as
the managed representation?
 

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

Back
Top