Skip to content

Example: With or without the 'EReader'

Jan Boonen edited this page Jul 25, 2015 · 1 revision

The following is a basic framework when using the EReader

#include "TwsApiL0.h"

class YourEWrapper: public EWrapperL0 {
  public:

  ...
}

int main {
    YourEWrapper  YW();
    EClientL0*    EC = EClientL0::New( &YW );

    if( EC->eConnect( "", 7496, 100 ) ) {
      
      while( NOT DONE ) {
        ...
      }      

    }

    EC->eDisconnect();
    delete EC;
}

The following is a basic framework when not using the EReader

#include "TwsApiL0.h"

class YourEWrapper: public EWrapperL0 {
  public:
  YourEWrapper( void ): EWrapperL0( false ) {}

  ...
}

int main {
    YourEWrapper  YW();
    EClientL0*    EC = EClientL0::New( &YW );

    if( EC->eConnect( "", 7496, 100 ) ) {

      while( NOT DONE ) {
        EC->checkMessages();
        ...
      }      

    }

    EC->eDisconnect();
    delete EC;
}
Clone this wiki locally