Announcement

Collapse
No announcement yet.

TimeAndSales request

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

  • TimeAndSales request

    Hi, I have been integrating our application with your desktop API. The current problem that we have is a weird message that we get from the timeandsales event when trying to access the time and sales bar.

    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)).
    at IESignal.HooksClass.ReleaseTimeSales(Int32 lHandle)
    at ESignalAPI.API.esignal_OnTimeSalesChanged(Int32 lHandle) in c:\projects\tradingplatform

    Please note that this can work fine for a good hour.

    Thanks!

    Adam


    I am using visual studio 2005 but the DLL that's integrating with esignal was compiled with 2003. we can’t compile the whole project with 2003 because our
    Brokerage firm only offers a .net 2.0 DLL to integrate with their systems.


    The way I request time and sales is by getting the last bar (0) and updating what we need with the relevant value.

    Should I first check to see if there are any new realtime bars?

    int rtBars = esignal.get_GetNumTimeSalesRtBars(lHandle);
    lastHistoryBarsCount = (int)tsHistoryBarsCount[lHandle];
    int dif2 = (rtHistoryBars - lastHistoryBarsCount);
    if dif2 ....... get the last bar at index 0

  • #2
    The easy check for this is to make sure you aren't already in a message handler and get called again. I believe it might be a problem with recursively calling into the COM object.

    Comment

    Working...
    X