ANVIL API (Assent) Developer Thread

Discussion in 'Trading Software' started by ctarmor-et, Dec 10, 2007.

  1. Have you tried running it in service mode ? You could use an AT job to start/stop it every day ...
     
    #41     Jan 16, 2008
  2. In addition to tjfield comment, you can create your dialog resource like this:

    g_pCDlgStatusMsg = new CDlgStatusMsg:):AfxGetMainWnd());
    g_pCDlgStatusMsg->Create(IDD_STATAMSGDLG, ::AfxGetMainWnd());
    g_pCDlgStatusMsg->ShowWindow(SW_SHOW);
     
    #42     Jan 16, 2008
  3. I finally found the code :D

    .....
    B_StartIteration(bBid ? m_bidIterator : m_askIterator);
    return (BookEntry *) B_GetNextBookEntry(bBid ? m_bidIterator : m_askIterator);

    This will give you the first Leve2 quote in the book. Create the iteratros as follow:

    // Book Iteratros
    unsigned int bookQuotesIntegrated[MAX_BOOKS];
    for(unsigned int i = 0; i < MAX_BOOKS; i++)
    bookQuotesIntegrated = 1;
    unsigned int mmLines = 1;//0xFFFFFFFF - all
    static bool ecnsOnly = false;
    static bool twoDecPlaces = true;
    m_bidIterator = B_CreateLevel2AndBookIterator(m_stockHandle, true, ecnsOnly, twoDecPlaces, bookQuotesIntegrated, mmLines, this);
    m_askIterator = B_CreateLevel2AndBookIterator(m_stockHandle, false, ecnsOnly, twoDecPlaces, bookQuotesIntegrated, mmLines, this);


    You can find more samples in the AnviExtTest sample
     
    #43     Jan 16, 2008
  4. tfjield

    tfjield

    I can run Anvil in service mode, but I'm finding that it's not loading my DLL, which it does during a normal logon... Any ideas?

    Anyway, I'm still debugging, so I would like to run it from the debugger. If I start it before the servers shut down and let it run all night, it properly reconnects to the servers in the morning. But if I'm a bit too late, I need to start it manually in the a.m.

    I'm not sure why pre-loading the real account from the A account doesn't work.
     
    #44     Jan 17, 2008
  5. I never used it in service mode. Are you using the SYSTEM account on the serivce registration ?

    I have not dealt with automatically loading the account. We manually open ANVIL in the morning since we run a gray box.
     
    #45     Jan 17, 2008
  6. Has anyone been noticing these msgs form the account observeable ?

    MSGID_CONNECTION_FAILED
    MSGID_CONNECTION_STARTED

    FAILED seems to happen every 20 seconds after STARTED. Once FAILED is received, it taked 4 seconds to get the STARTED one.

    The funny thing is that most time than not, data still continues to flow .... weird...
     
    #46     Jan 23, 2008
  7. tfjield

    tfjield

    I haven't noticed them, but I haven't been looking for them, either. Tonight I'll add trace statements to see if I'm getting them and we can go from there.
     
    #47     Jan 23, 2008
  8. I did not see this posting earlier.

    Loading the dll: Could it be becasue the service working folder is system32 ?

    To debug you could start the service and "attach" to the process for debugging.

    Just wondering, what account are you running the service ?
     
    #48     Jan 23, 2008
  9. tfjield

    tfjield

    I'm not sure that the working folder matters... I thought about that, but the path to the DLL folder is explicit.

    But you just made me think of something... Maybe it isn't even finding Anvil.ini. I'll try moving it to system32 and seeing if that helps. Thanks!

    I have tried to attach to the service, which I can do, but if I place a break point on, say, my PreTranslateMessage routine, nothing gets hit. Also, my DLL creates a log file to dump trace statements into, and that file isn't created, all making me believe that the DLL is not being run.

    I'm running it with credentials to use my desktop -- the one I'm logged in to.
     
    #49     Jan 23, 2008
  10. I do not know if you tried this but once the service is running, try digging into the loaded dlls using the old listdlls from Mark R.

    http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/ListDlls.mspx
     
    #50     Jan 24, 2008