Share via


Error code received : Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

Question

Thursday, May 26, 2011 9:21 AM

Hi,

Here is the problem I have encountered :

Scenario :

I am trying to achieve asynchronous messaging between 1 server and X number of clients (on different IPs). As a part of the system in the client, I have used threading for receiving messages :

thrMessaging = new Thread(new ThreadStart(ReceiveMessages));
            thrMessaging.Name = ("Thread{0}Message");
            thrMessaging.Start();

Once a message is received, it calls the ReceiveMessages function, which subsequently calls the following functions : schedule_Execution() then CreateNewOrderSch(). Keep in mind that I am still running on the new thread - "Thread{0}Message", as part of the CreateNewOrderSch() functions, I was hoping to assign m_instr (variable defined in the namespace) to a profile attribute. This is the point I have encountered the error (Error code received : Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

TTOrderProfile profile = new TTOrderProfile();  
profile.Instrument = m_instr;

Def

namespace TT_MEAPI
{
    /// <summary>
    /// Main form: Inherit all the MEAPI classes
    /// </summary>
    public partial class frmTTMeapi : Form,
                              

        ITTMarketExplorerEvents,
                                      ITTGatewayEvents,
                                      ITTProductEvents
    {
private TTInstrObj m_instr = null;

//code omitted
}

Comment:

I think the error is trying to tell me that I can refer to the m_instr object as it was not defined in the "Thread{0}Message" thread, was wondering if you please give me some advice on this?

Please keep in mind that TTOrderProfile object is in a ref DLL written in C++ and I was told that this is an error on interop between a COM obj(unmanaged) and .Net program(managed)?

Any suggestions would be highly appreciated, thanks!

All replies (1)

Wednesday, June 1, 2011 7:19 AM

Hi coding,

Sorry for delay! RPC_E_SERVERFAULT means that an exception occured on the server. So in order to understand what actually happened, you'll need to debug the server.

If you are using the Visual Studio debugger,  please turn off "just my code" in the debugger options to attach both the native and managed debuggers, and enable catching of Win32, C++, and COM+ exceptions in the debugger.

Related thread:

http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/b0ac73a4-7a54-4d10-a1dd-54404ff1678e/

http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/d00cc217-fb84-465a-979e-ed3c9d13056d/

 

Best regards,

Lucy

Lucy Liu [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.