Download VALUES API Interface Specification Release 2 Production Version
Transcript
Deutsche Börse - Xetra
VALUES API Interface Specification Release 2
Production Version
VALUES API Usage Examples
04-Dec-1997
Page 170
Initiating a VALUES Session
5.2
Initiating a VALUES Session
The VCI_Connect entry point is used to connect the application to VALUES. After a successful
VCI_Connect, the application can send subscription application requests, or perform login into
the Back End systems.
// code example VCI_Connect
#include “Values.h”
#include “ehs_konst.h”
#include “requests.h”
// global definitions: the stack persistency is not enough for these variables as they must be used across multiple
// application functions
int
myConnectionID;
// myConnectionId identifies the session and
// is mandatory input for all future interface calls
char
prodMode;
// application can use prodMode to inform
// the user about the production mode
void connect_function()
{
// local variables
int
myVMQ;
// define variables in VCI-format
ReqCntrlT
CnctReqDataT
CnctRespDataT
StatusDataT
AppCntxtDataT
reqControl;
*reqData;
respData;
statusDataGlobal;
*callbackContextData;
// fill the field ‘VCIver’ of reqControl
// VCI_VERSION is a VALUES constant
strcpy(reqControl.VCIver, VCI_VERSION);
// set VALUES version for compatibility checking
// allocate memory for reqData (this memory has to be deallocated after disconnecting)
reqData = (CnctReqDataT *) malloc(sizeof(CnctReqDataT));
// fill the fields of the reqData-structure
// the userId and password should come from a user or a file and not be
// hardcoded
strcpy(reqData->userID, “johnson“);
// FE operating system userID for VALUES or
// DB-application
strcpy(reqData->password, “pencil“);
// FE operating system password for userID
// allocate memory for callbackContextData (this memory has to be deallocated after disconnecting)
callbackContextData = (AppCntxtDataT *) malloc(sizeof(AppCntxtDataT));