Announcement

Collapse
No announcement yet.

Unable to cast COM object of type 'IESignal.HooksClass' to interface type 'IESignal.I

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to cast COM object of type 'IESignal.HooksClass' to interface type 'IESignal.I

    Hello,
    Our application is crashing with the following error message. This is happening in our "eSignal_OnQuoteChanged" event handler, specifically when we make the call to "BasicQuote q = eSignal.get_GetBasicQuote(sSymbol);"

    My thought was to re-initialize the eSignal object with another call to:
    "eSignal = new IESignal.Hooks();" but this call throws yet another exception.

    So, 2 questions.
    1. What causes the following error
    2. What is the proper way to recover from this error (currently we need to force-stop our app and manually kill the WinSig and WinROS processes).

    Error/Exception message:

    Unable to cast COM object of type 'IESignal.HooksClass' to interface type 'IESignal.IHooks'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{C5916B45-A7EB-4919-A742-AD47AE3AE996}' failed due to the following error: System call failed. (Exception from HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)).

  • #2
    This error often indicates resource issues. When a system call is made the calling application is interrupted, and if data is still coming in trying to fire events there can be problems. Here is a good overview on system calls:


    System_call

    Comment


    • #3
      Hey Guys,

      I know this is an old thread, but I wanted to dig it up because I'm still having this problem.

      As with cosgrove, I am getting an invalidCastException thrown but I'm dealing with time sales data, so its thrown during Gettimesalesbar during ontimesaleschanged.

      Of some importance may be that the COM Object type that im casting from is not IESignal.HooksClass but System.ComObject_. I understand from AveryH's comments that this is a resource issue, however I don't understand how. From my understanding, this program is not multithreaded, therefore esignal must wait for ontimesaleschanged to finish before it can initiate another call. Why would it be trying to fire another event if the first sub had not been exiting?

      Unless, of course, youre indicating that in the time between when ontimesaleschanged and when I call gettimesalesbar that the esignal application has not finished sending information to my VB program?

      Thanks again,

      Jett

      Comment


      • #4
        Hi cosgrove did you solve this problem.
        I have the same problem and I don't know what to do.

        Thanks

        Comment


        • #5
          Originally posted by smilja
          Hi cosgrove did you solve this problem.
          I have the same problem and I don't know what to do.

          Thanks
          The problem was in our code.

          It seems that our event handler is getting called almost faster than our code was returning from the "GetBasicQuote" call. (We were doing some DB logging after we made this call).

          This was causing some deadlocking issues on our side (DeadlyEmbrace). So we changed the code that called "GetBasicQuote" so that there was no processing after we made that call.

          Then when the eventHandler got called, we were able to process the message successfully.

          I hope this helps.

          Comment


          • #6
            Thank you for your suggestion.
            We had similar problem in our code.

            Comment

            Working...
            X