The Captive Data Engine publishes an API interface in the form of a Windows DLL. The DLL cannot function without the engine resident so if it cannot communicate with the engine it will attempt to execute the engine minimized to the taskbar. The DLL and the engine must remain together as the DLL will only execute the engine if it is found in the same directory.
Once running the API gives access to all engine data including racesheets, results, meeting lists and the current bettordata system time. The interface is a very simple one that can be completely controlled by 19 function calls. These calls are:
Definition Syntax
int InitAPI( void );Example
#include "api.h"
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The data engine is unavailable", "Error", MB_OK );
exit(0);
}
//at this point we can call any other functions we desire
//dont forget to call CloseAPI() and FreeLibrary() when done
Return Values
| CDBDE_ENGINE_ONLINE | The engine is online and responding |
| CDBDE_ENGINE_UNAVAILABLE | The engine is offline and could not be automatically started |
Remarks
InitAPI() must be called prior to calling any other functions of the API as this call initializes communications with the engine therefore no comms between the engine and API can be supported without a successful call to InitAPI(). The Auto-loading of the Engine by the API is triggered by InitAPI(). This function in cooperation with the CloseAPI function should also be used when a comms error causes a function to return the value CDBDE_COMMSERROR_INITAGAIN. Should you get this error condition returned byt any function, your program should call CloseAPI() followed by InitAPI() to re-initialize communications between the API and the engine.
Definition Syntax
void CloseAPI( void );Example
#include "api.h" //assuming we have previously opened the API with a call to InitAPI() CloseAPI();
Return Values
| None |
Remarks
CloseAPI() must be called once all activity via the API has ceased and prior to the call to the windows FreeLibrary() to unload the DLL. This function should also be called and followed by a call to InitAPI() on reception of the error condition CDBDE_COMMSERROR_INITAGAIN from any API function. This function does not close the engine down, even if it was automatically loaded using IniAPI(), this is so that should a user close your program down, incoming data will not be lost while your application is offline.
Definition Syntax
int GetMeet( char *buf, //pointer to a buffer of sufficient size to accept the information int *len //pointer to an integer which has be preset to the size of 'buf' above );Example
#include "api.h"
char *buffer;
int retval;
int buflen=16384; //reasonable amount of memory to allow for up to 50 meets
if( ( buffer = (char *)malloc(buflen) ) == NULL)
{
MessageBox ( NULL, "Error Allocating Memory For The Meetings Buffer", "Error", MB_OK );
exit(0);
}
if( ( retval = GetMeet( buffer, &buflen ) )!= CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
free(buffer);
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling GetMeet()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling GetMeet()", "Error", MB_OK );
return FALSE;
}
//Here the buffer contains the list of meets for the day.
//Process the data into a meetings array, grid or other suitable container
free(buffer);
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the meet. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
GetMeets() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int GetTime( char *buf, //pointer to a buffer of sufficient size to accept the information int *len //pointer to an integer which has be preset to the size of 'buf' above );Example
#include "api.h"
char *buffer;
int retval;
int buflen=128; //reasonable amount of memory to allow for the time to be returned
if( ( buffer = (char *)malloc(buflen) ) == NULL)
{
MessageBox ( NULL, "Error Allocating Memory For The Meetings Buffer", "Error", MB_OK );
exit(0);
}
if( ( retval = GetTime( buffer, &buflen ) )!= CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
free(buffer);
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling GetTime()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling GetTime()", "Error", MB_OK );
return FALSE;
}
//Here the buffer contains the 8 character text version of the time HH:MM:SS
free(buffer);
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the time. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
GetTime() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int GetRace( char *buf, //pointer to a buffer of sufficient size to accept the information int *len, //pointer to an integer which has been preset to the size of 'buf' above int refstate, //state which codes are being used as a reference in 'meet' below char *meet, //meeting code or reference defining the race meeting or an automatic action to take (see below) char *race, //race number (as a string) or automatic action to take (see below) int state, //the state (TAB) to return approximate dividends or abstractions for int pool, //the pool to return approximate dividends or abstractions for int updates, //the number of update columns to include int summary //flag whether to summarise updates into known intevals or provide actual updates );
Parameters
| buf | A pointer to a buffer of sufficient size to accept the information. As some records returned here can be quite voluminous. It is best too keep this around 16K to be sure larger races can be returned in full. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| len | Pointer to an integer which has been preset to the size of buf above. On return the integer pointed to will contain the number of bytes used. If this value remains the same upon successful return (ie the full size of buf), this indicates that the response may have been truncated. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Refstate |
Represents the state which codes are being used as a reference in the meet
parameter below. These references include a range of automated
references which can automatically return meetings based on next or
last race to jump relative to the current time.
These codes are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| meet | This parameter is only important if the value for refstate is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or CDBDE_REFCODE_UNITAB, otherwise it is ignored. This null ended string sting refers to the 2 character race code used by each state to identify a meeting. This code often varies from TAB to TAB and should be matched to the codes returned for each TAB by the GetMeets() function. For example if GetMeets() returns a Tab Limited code for a meeting as "PR" this can be passed as the meets parameter if the value for refstate, is CDBDE_REFCODE_TABLIMITED. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| race |
This parameter is only important if the value for refstate
is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or
CDBDE_REFCODE_UNITAB, otherwise it is ignored.
This null ended string sting refers to either a race number in the
range "1" to "12" or it refers to a special code which defines next or
last race to jump of the meeting defined in the meets parameter.
The special values and their meanings are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state |
This parameter is required regardless of the setting of refstate
This value defines which TAB to return dividends or abstractions for.
There are currently 3 TABs to choose from:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pool |
This parameter is required regardless of the setting of refstate
The value defines which pool you require the race sheets to quote, dividend pool or abstractions.
There are currently 5 pools you can request data for:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updates | This parameter is required regardless of the setting of refstate The value defines how many price update columns should appear to the right of the returned race sheet. The valid range is 3 to 30. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| summary |
This parameter is required regardless of the setting of refstateThe
value defines whether you require every actual update to be shown or
whether you wish the updates to be summarised into known intervals.
The values are:
|
Example
#include "api.h"
//we use fixed stack based buffers this time
char buffer[3][16384];
int buflen[3]={ 16384,16384,16384 }; //reasonable amount of memory to allow for a full racesheet
//comment in the ones you wish to try
//standard race sheet for Tabcorp Win pool for the PR 3 (using the Tab Limited code)
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_TABLIMITED, "PR", "3", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 10, CDBDE_MODE_NOSUMMARY );
//the same race sheet selected by Tabcorp's code instead
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_TABCORP, "2R", "3", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 10, CDBDE_MODE_NOSUMMARY );
//the same meet but this time requesting next to jump rather than race 3
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_TABCORP, "2R", "N2", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 10, CDBDE_MODE_NOSUMMARY );
//this time we are asking for the next to jump out of all meets, holding for 1 minute after the jump
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 10, CDBDE_MODE_NOSUMMARY );
//this time the same sheet but summarize the data into known intervals so we can do an interstate
//comparison of the prices at different stages of the market, each states request is shown.
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABCORP, CDBDE_POOL_WIN, 4, CDBDE_MODE_SUMMARIZE );
//retval = GetRace( buffer[1], &buflen[1], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABLIMITED, CDBDE_POOL_WIN, 4, CDBDE_MODE_SUMMARIZE );
//retval = GetRace( buffer[2], &buflen[2], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_UNITAB, CDBDE_POOL_WIN, 4, CDBDE_MODE_SUMMARIZE );
//this time a plain Tabcorp place pool at known intervals so we can look ath the market trend for each runner
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABCORP, CDBDE_POOL_PLACE, 10, CDBDE_MODE_SUMMARIZE );
//now to analyse overs between the win and trifecta pools we need to get 2 sheets and then process them to compare
//retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABLIMITED, CDBDE_POOL_WIN, 10, CDBDE_MODE_SUMMARIZE );
//retval = GetRace( buffer[1], &buflen[1], CDBDE_REFCODE_NEXT_TO_JUMP_HOLD1MIN, "", "", CDBDE_STATE_TABLIMITED, CDBDE_POOL_TRIFECTA, 10, CDBDE_MODE_SUMMARIZE );
//now back to the last race to jump on Melbourne Dogs using the UniTAB code and showing the Qld win Pool, last 20 updates
retval = GetRace( buffer[0], &buflen[0], CDBDE_REFCODE_UNITAB, "VG", "L0", CDBDE_STATE_UNITAB, CDBDE_POOL_WIN, 20, CDBDE_MODE_NOSUMMARY );
if( retval!=CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling GetRace()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling GetRace()", "Error", MB_OK );
return FALSE;
}
//Process the data however you wish
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the racesheet. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
GetRace() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int Result( char *buf, //pointer to a buffer of sufficient size to accept the information int *len, //pointer to an integer which has been preset to the size of 'buf' above int refstate, //state which codes are being used as a reference in 'meet' below char *meet, //meeting code or reference defining the race meeting or an automatic action to take (see below) char *race, //race number (as a string) or automatic action to take (see below) int state //the state (TAB) to return result for );
Parameters
| buf | A pointer to a buffer of sufficient size to accept the information. It is best too keep this around 2K to be sure larger results can be returned in full. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| len | Pointer to an integer which has been preset to the size of buf above. On return the integer pointed to will contain the number of bytes used. If this value remains the same upon successful return (ie the full size of buf), this indicates that the response may have been truncated. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Refstate |
Represents the state which codes are being used as a reference in the meet
parameter below. These references include a range of automated
references which can automatically return meetings based on next or
last race to jump relative to the current time.
These codes are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| meet | This parameter is only important if the value for refstate is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or CDBDE_REFCODE_UNITAB, otherwise it is ignored. This null ended string sting refers to the 2 character race code used by each state to identify a meeting. This code often varies from TAB to TAB and should be matched to the codes returned for each TAB by the GetMeets() function. For example if GetMeets() returns a Tab Limited code for a meeting as "PR" this can be passed as the meets parameter if the value for refstate, is CDBDE_REFCODE_TABLIMITED. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| race |
This parameter is only important if the value for refstate
is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or
CDBDE_REFCODE_UNITAB, otherwise it is ignored.
This null ended string sting refers to either a race number in the
range "1" to "12" or it refers to a special code which defines next or
last race to jump of the meeting defined in the meets parameter.
The special values and their meanings are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state |
This parameter is required regardless of the setting of refstate
This value defines which TAB to return results for.
There are currently 3 TABs to choose from:
|
Example
#include "api.h"
//we use fixed stack based buffers this time
char buffer[2048];
int buflen=2048; //reasonable amount of memory to allow for a full result
//get the result for Sydney Harness race 5 on UniTAB selected by the UniTAB code
retval = Result( buffer, &buflen, CDBDE_REFCODE_UNITAB, "ST", "5", CDBDE_STATE_UNITAB);
if( retval!=CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling Result()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling Result()", "Error", MB_OK );
return FALSE;
}
//Process the data however you wish
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the racesheet. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
Result() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int GetID( char *buf, //pointer to a buffer of sufficient size to accept the information int *len //pointer to an integer which has be preset to the size of 'buf' above );Example
#include "api.h"
char *buffer;
int retval;
int buflen=128; //reasonable amount of memory to allow for the time to be returned
if( ( buffer = (char *)malloc(buflen) ) == NULL)
{
MessageBox ( NULL, "Error Allocating Memory For The GetID Buffer", "Error", MB_OK );
exit(0);
}
if( ( retval = GetID( buffer, &buflen ) )!= CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
free(buffer);
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling GetID()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling GetID()", "Error", MB_OK );
return FALSE;
}
//Here the buffer contains the subscription information in the format
//OK ID type,internal_id,valid,days_left
//On decoders, type is always 1 to indicate a hardware decoder is in use.
free(buffer);
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the information. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
GetID() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int LoadShadow( char *filename //pointer to a null ended string containing a full path to the shadow file to load );Example
#include "api.h"
if(LoadShadow("D:\\20040517.txt")==CDBDE_COMMAND_COMPLETED)
{
//the file was loaded, access the data for 20040517 as required
}
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the shadow file loaded. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request (ie the file wasn't found or could not be opened). |
Remarks
LoadShadow() must be preceded by a successful call to InitAPI().
Definition Syntax
int GetQuinella( char *buf, //pointer to a buffer of sufficient size to accept the information int *len, //pointer to an integer which has been preset to the size of 'buf' above int refstate, //state which codes are being used as a reference in 'meet' below char *meet, //meeting code or reference defining the race meeting or an automatic action to take (see below) char *race, //race number (as a string) or automatic action to take (see below) int state //the state (TAB) to return exotics for ); //note: same format for GetExacta, GetTrifecta,GetFirstFour,GetDailyDouble,GetRunningDouble & GetQuadrella
Parameters
| buf | A pointer to a buffer of sufficient size to accept the information. It is best too keep this around 16K as some exotic formats can be quite voluminous and you need to be sure larger responses can be returned in full. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| len | Pointer to an integer which has been preset to the size of buf above. On return the integer pointed to will contain the number of bytes used. If this value remains the same upon successful return (ie the full size of buf), this indicates that the response may have been truncated. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Refstate |
Represents the state which codes are being used as a reference in the meet
parameter below. These references include a range of automated
references which can automatically return meetings based on next or
last race to jump relative to the current time.
These codes are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| meet | This parameter is only important if the value for refstate is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or CDBDE_REFCODE_UNITAB, otherwise it is ignored. This null ended string sting refers to the 2 character race code used by each state to identify a meeting. This code often varies from TAB to TAB and should be matched to the codes returned for each TAB by the GetMeets() function. For example if GetMeets() returns a Tab Limited code for a meeting as "PR" this can be passed as the meets parameter if the value for refstate, is CDBDE_REFCODE_TABLIMITED. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| race |
This parameter is only important if the value for refstate
is CDBDE_REFCODE_TABCORP, CDBDE_REFCODE_TABLIMITED or
CDBDE_REFCODE_UNITAB, otherwise it is ignored.
This null ended string sting refers to either a race number in the
range "1" to "12" or it refers to a special code which defines next or
last race to jump of the meeting defined in the meets parameter.
The special values and their meanings are:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| state |
This parameter is required regardless of the setting of refstate
This value defines which TAB to return results for.
There are currently 3 TABs to choose from:
|
Example
#include "api.h"
//we use fixed stack based buffers this time
char buffer[16384];
int buflen=16384; //reasonable amount of memory to allow for a full response
//get the exacta table for Sydney Harness race 5 on UniTAB selected by the UniTAB code
retval = GetExacta( buffer, &buflen, CDBDE_REFCODE_UNITAB, "ST", "5", CDBDE_STATE_UNITAB);
if( retval!=CDBDE_COMMAND_COMPLETED ) //we have the data ?
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling GetExacta()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling GetExacta()", "Error", MB_OK );
return FALSE;
}
//Process the data however you wish
return TRUE;
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully and the buffer contains the racesheet. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
| CDBDE_COMMSERROR_INVALID | The engine responded with a negative response to the request. |
Remarks
GetQuinella(),GetExacta() and GetTrifecta() must be preceded by a successful call to InitAPI(). See the section on Data Definition for a detailed description of the data deposited in the passed buffer. On return 'buf' contains the requested data if CDBDE_COMMAND_COMPLETED was returned from the call. On return 'len' is set to the length of the data contained in 'buf' if CDBDE_COMMAND_COMPLETED was returned from the call.
Definition Syntax
int EngineToSysTray( void );Example
int EngineFromSysTray( void );
#include "api.h"
int retval;
//tell the engine to minimize itself to the system tray
retval=EngineToSysTray();
if( retval!=CDBDE_COMMAND_COMPLETED )
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling EngineToSysTray()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling EngineToSysTray()", "Error", MB_OK );
return FALSE;
}
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
Remarks
EngineToSysTray() and EngineFromSysTray() must be preceded by a successful call to InitAPI().
If it fails an error is returned.
Definition Syntax
int SuspendCapture( void );Example
int ResumeCapture( void );
#include "api.h"
int retval;
//tell the engine to cease capturing data
retval=SuspendCapture();
if( retval!=CDBDE_COMMAND_COMPLETED )
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling SuspendCapture()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling SuspendCapture()", "Error", MB_OK );
return FALSE;
}
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
Remarks
SuspendCapture() and ResumeCapture() must be preceded by a successful call to InitAPI().
Definition Syntax
int AutoDownload( void );Example
#include "api.h"
int retval;
//tell the engine to download the latest data
retval=SuspendCapture();
if( retval!=CDBDE_COMMAND_COMPLETED )
{
if( retval == CDBDE_COMMSERROR_INITAGAIN )
{
MessageBox ( NULL, "A Communication Error Has Occurred Calling AutoDowload()", "Error", MB_OK );
CloseAPI();
if( InitAPI() != CDBDE_ENGINE_ONLINE )
{
MessageBox ( NULL, "The Data Engine Is No Longer Available", "Error", MB_OK );
exit(0);
}
}
else
MessageBox ( NULL, "An Error Condition Was Returned From The Engine When Calling AutoDowload()", "Error", MB_OK );
return FALSE;
}
Return Values
| CDBDE_COMMAND_COMPLETED | The request was answered successfully. |
| CDBDE_COMMSERROR_INITAGAIN | A comms error has occurred, you will need to re-initialize using CloseAPI() and InitAPI(). |
Remarks
AutoDowload() must be preceded by a successful call to InitAPI().
| OK HH:MM:SS or OK ?????? HH:MM:SS | No Error, data follows. ?????? is replaced by a request specific message in some cases |
| ER1 Unknown Command | The command issued is unknown - this should not occur via the API |
| ER2 Result Overflow | The result of the command was too large to buffer in the space provided by the caller |
| ER3 Buffer Full | The communication buffer between the API and the engine is full. The request could not be processed |
| ER4 Command Too Long/Short (n/256) | The command issued by the API was either zero bytes or more than 256 bytes - this should not occur via the API |
| ER5 Selector Rejected | Now redundant |
| ER6 Invalid Parameter To Command | An invalid parameter value was received |
| ER7 Meeting Not Found | The meeting code you have supplied could not be successfully matched to a meeting on record |
| ER8 Race Not Found | The race number you have supplied could not be successfully matched to a race at that meeting |
| ER9 State Code Not Valid | The state code you gave was not valid |
| ER10 Pool Code Not Valid | The pool code you gave was not valid |
| ER11 No Updates Available For This Race | While the race was found, no updates are available yet for this TAB |
| ER12 No Result Available Yet For This Race | While the race was found, no result is available yet for this TAB |
| ER13 No Shadow File Found Or File Error | The file you specified to load was not found |
| ER14 Quinella Overflow | The response from the command was too large to buffer in the space provided by the caller |
| ER15 No Quinella Information Found | While the race was found, no quinella information is available yet for this TAB |
| ER16 Exacta Overflow | The response from the command was too large to buffer in the space provided by the caller |
| ER17 No Exacta Information Found | While the race was found, no exacta information is available yet for this TAB |
| ER18 Trifecta Overflow | The response from the command was too large to buffer in the space provided by the caller |
| ER19 No Trifecta Information Found | While the race was found, no trifecta information is available yet for this TAB |
| ER20 MultiExotic Overflow | The response from the command was too large to buffer in the space provided by the caller |
| ER21 No MultiExotic Information Found | While the race was found, the exotic information requested is not available yet for this TAB |
| ER999 Unknown Error (n) | An undocumented error was generated, the error number is identified in brackets |