Genesis API Initialization

Discussion in 'Automated Trading' started by nbraid, Aug 24, 2010.

  1. nbraid


    My GTSession::Initialize function is failing every time I call it. Does anyone know why this would be?

    I've been told by the Genesis agent I've been in contact with that the version number argument shouldn't make much of a difference, and the Instance is being left at NULL and the flag is left at 0.

    Just to fill out the argument, I have the version number as for the C++ version, since it is the only version which seems to only have 3 numbers.

    Thanks to anyone who can help.
  2. BOOL CTestAPIApp::InitInstance()

    if(GTSession::Initialize(GTAPI_VERSION) != 0)
    return FALSE;

    // Standard initialization
    // If you are not using these features and wish to reduce the size
    // of your final executable, you should remove from the following
    // the specific initialization routines you do not need.

    #ifdef _AFXDLL
    // Enable3dControls(); // Call this when using MFC in a shared DLL
    // Enable3dControlsStatic(); // Call this when linking to MFC statically

    CTestAPIDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    // TODO: Place code here to handle when the dialog is
    // dismissed with OK
    else if (nResponse == IDCANCEL)
    // TODO: Place code here to handle when the dialog is
    // dismissed with Cancel

    // Since the dialog has been closed, return FALSE so that we exit the
    // application, rather than start the application's message pump.
    return FALSE;
  3. promagma


    Yep I had that problem .... I have some vague memories from years ago that it had to do with threading model. Initialize failed under MTA and worked under STA (or was it vice-versa lol) :D