Return values, Remarks, Example – MagTek Excella STX99875340 User Manual
Page 33

Section 3. Excella API
23
Return Values
MICR_ST_OK
MICR_ST_NOT_ENOUGH_MEMORY
MICR_ST_ERR_LOAD_XML
MICR_ST_ERR_GET_DOM_POINTER
MICR_ST_BAD_DATA
MICR_ST_BAD_SECTION_NAME
MICR_ST_BAD_KEY_NAME
MICR_ST_BAD_VALUE_BUFFER
MICR_ST_BAD_BUFFER_LENGTH
MICR_ST_KEY_NOT_FOUND
Remarks
MTMICRGetValue finds the key in the pcDocInfo buffer then returns its value in the pcValue.
If MTMICRGetValue succeeds it returns MICR_ST_OK.
If pdwLength is less than the size of the returned value then MICR_ST_NOT_ENOUGH_MEMORY is returned
and the required size for the pcValue buffer is returned in the pdwLength.
If the key/value pair can not be found, then a NULL is returned for pcValue and error parameter
MICR_ST_KEY_NOT_FOUND is returned.
Example
char Settings [4096];
char DocInfo [4096];
char device[4096] ="";
DWORD SettingsBufferSize;
DWORD DocInfoSize;
char cValue [1024];
DWORD valueSize;
DWORD dwStatus;
// Initialize Settings
DocInfoSize = 4096;
// Use function MTMICRGetDevice to get device name for variable “device”
// Call MTMICRProcessCheck function to process a document.
dwStatus = MTMICRProcessCheck (device, Settings, DocInfo, &DocInfoSize);
if (dwStatus == MTMICR_ST_OK)
{
//Let us check the return status from the device
valueSize = 1024;
dwStatus=MTMICRGetValue(DocInfo, "CommandStatus", "ReturnCode", cValue,
&valueSize);
if (dwStatus != MICR_ST_OK)
// error retrieving key value
else
{
// do further process
}
}