8 mtecsdk_getvalue, Mtecsdk_getvalue, 2 - functions – MagTek EC2000 99875713 User Manual

Page 16

Advertising
background image

2 - Functions

ExpressCard 2000| Instant Issuance Card Personalization System | Programmer’s Reference (Windows SDK)

Page 16 of 21

If there is no data returned from device, the return value is EC_ST_PROCESS_DOC_FAILED.
If pcProcessOptions is NULL, the return value is EC_ST_BAD_DATA.
If pcDocInfo is NULL, the return value is EC_ST_BAD_BUFFER.
If the size of returned data is larger than the value specified in pdwDocInfoSize, the return value is
EC_ST_NOT_ENOUGH_MEMORY.
If there is a bad connection with the device, the return value will be one of the following:
EC_ST_CONNECT_REQUEST_TIMEDOUT
EC_ST_REQUEST_TIMEDOUT
EC_ST_DEVICE_NOT_RESPONDING
EC_ST_ERR_INTERNET_CONNECT
EC_ST_ERR_HTTP_OPEN_REQUEST
EC_ST_ERR_HTTP_SEND_REQUEST

Example:
#define BUFFER_LEN 4096

char docInfo [BUFFER_LEN];
char options [BUFFER_LEN];
char Device[4096] ="";
DWORD docInfoSize;;

// Set up options using function MTECSDK_SetValue
// Use function MTECSDK_GetDevice to get device name for variable
“Device”

docInfoSize = BUFFER_LEN;
dwStatus=MTECSDK_ProcessDoc(Device, options, docInfo, &docInfoSize);

// Use MTECSDK_GetValue to parse the docInfo.

2.8 MTECSDK_GetValue

This function retrieves a key/value pair that was previously stored in the pcDocInfo parameter using
MTECSDK_SetValue function.

ULONG MTECSDK_GetValue (

char *pcDocInfo,

char *pcSection,

char *pcKey,

char *pcValue,

DWORD *pdwLength

);


Parameters:
pcDocInfo - Buffer pointer containing all the key/value pairs.
pcSection - Pointer to null-terminated string containing the section name.
pcKey - Pointer to null-terminated string containing the key name.
pcValue - Pointer to the buffer that receives the retrieved string.
pdwLength - Specifies the size of the pcValue buffer.

Return Values:

Advertising