RPC_E_SERVERFAULT exception

J

jiabingg

Hi,

I got the following exception when I'm calling a COM method from C#.
The exception was caught by C# exception handler.

Exception Message: The server threw an exception. (Exception from
HRESULT: 0x80010105 (RPC_E_SERVERFAULT)).

The COM code is just to return the length of a vector like below, but
it failed.
try
{
long l = myVector.size(); //exception happened here when debugging
}
catch (_com_error& err)
{
//handle com error
}
catch (...)
{
//handle C++ exceptions
}
From debugging, the exception happend when getting the size on vector.
My understanding is that I got some memory trashed, but I couldn't
figure out where is it.

I do get another AV exception before coming to here. I only know that
it happened at __DllMainCRTStartup, no more information.

Any information is welcome.

Thanks
Jia
 
W

Willy Denoyette [MVP]

| Hi,
|
| I got the following exception when I'm calling a COM method from C#.
| The exception was caught by C# exception handler.
|
| Exception Message: The server threw an exception. (Exception from
| HRESULT: 0x80010105 (RPC_E_SERVERFAULT)).
|
| The COM code is just to return the length of a vector like below, but
| it failed.
| try
| {
| long l = myVector.size(); //exception happened here when debugging
| }
| catch (_com_error& err)
| {
| //handle com error
| }
| catch (...)
| {
| //handle C++ exceptions
| }
|
| >From debugging, the exception happend when getting the size on vector.
| My understanding is that I got some memory trashed, but I couldn't
| figure out where is it.
|
| I do get another AV exception before coming to here. I only know that
| it happened at __DllMainCRTStartup, no more information.
|
| Any information is welcome.
|
| Thanks
| Jia
|

What exception is thrown on you when calling myVector.size(), what are you
doing in your catch(...) handler?

this:
long l = myVector.size(); //exception happened here when debugging

cannot throw a COM exception, so I don't get why you have a COM catch
handler in your server code.
You should also investigate the AV in your start-up code, you can't safely
ignore AV's.

Note that this is not C# related issue, you might get better answers when
posting to the vc NG at : microsoft.public.dotnet.languages.vc

Willy.
 

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