Announcement

Collapse
No announcement yet.

XMLGetFundamentalData always Crash when program run a while.

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

  • XMLGetFundamentalData always Crash when program run a while.

    That's weird. I wrote a little program to get OpenInterest . But the program only can work short time.

    About 10 or more minutes , XMLGetFundamentalData will crash with Error code 0x80010100 , the error code was return by raw_XMLGetFundamentalData.

    My Code-Segment

    void CES2TCPDlg::ES_OnQuoteChanged(CString strSymbol)
    {
    try
    {
    if(NULL == m_pXMLDoc)
    {
    ASSERT(NULL);
    return;
    }


    BSTR bStr = strSymbol.AllocSysString();
    _bstr_t bstrString(bStr);
    SysFreeString(bStr);
    _bstr_t fundamentalXML = (*m_piHooks)->XMLGetFundamentalData(bstrString , ftfOPENINT , 0);

    CString strValue;

    HRESULT hr;

    VARIANT_BOOL bStatus;

    hr = m_pXMLDoc->loadXML(fundamentalXML , &bStatus);
    IS_HR_FAILED(hr);

    if(VARIANT_TRUE != bStatus)
    {
    ASSERT(FALSE);
    return;
    }

    strQuote = B2S(fundamentalXML);
    if(-1 != strQuote.Find("OpenInterest"))
    {
    hr = GetValueFromXMLDoc(m_pXMLDoc , "OpenInterest" , strValue);
    if(SUCCEEDED(hr))
    {
    UpdateItemValue(strSymbol , "OpenInterest" , strValue);
    SetLastUpdate(strSymbol , "OpenInterest" , strValue);
    }
    }
    }
    catch (_com_error &e)
    {
    dump_com_error(e);
    return;
    }
    }


    BTW : I Use eSignal v7.8 Under WinXP

    Best Regards

  • #2
    Can you try this with eSignal 7.9 to see if your issue still exists?

    Comment


    • #3
      Unfortunately , The problem still exist when I use esignal v7.9.

      Comment


      • #4
        I know that this function works because I am working with one of our institutional customers on it.

        There are only 2 paramters in the function, but it seems you are passing 3. Could that be it?

        What if you request all data types, then find Open Interest?

        Comment


        • #5
          Not Only XMLGetFundamentalData has this problem but also XMLGetBasicQuote. I found when request a lot of symbols and the quote of these symbols changes too frequent , XMLGetFundamentalData or XMLGetBasicQuote will be crash.

          How can I get more example to learn XMLGetFundamentalData and XMLGetBasicQuote? thanks.


          BTW :

          In winsig.tlh , you can see these code :

          _bstr_t XMLGetFundamentalData (
          _bstr_t sSymbol,
          fundamentalTypeFlags fields,
          long lReserved);


          Obviously , the thrid parameter is reserved.

          Comment


          • #6
            You've got something else going on here because XMLGetBasicQuote works fine. There is a thread that describes this function in detail. This API does not work extremely well with very active symbols, especially when following many of them.

            Do you have at least 512 KB or even 1 GB RAM?

            Comment

            Working...
            X