Example – MagTek Excella STX99875340 User Manual
Page 49

Section 3. Excella API
39
Example
char Settings [4096];
char DocInfo [4096];
char device[4096] ="";
DWORD SettingsBufferSize;
DWORD DocInfoSize;
char cValue [1024];
DWORD valueSize;
DWORD dwStatus;
// Intialize 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 == MICR_ST_OK){
// Let us scan through all the key pair values returned in the DocInfo
DWORD sectionCount;
DWORD sectionIndex;
// Get total number of sections
if (MTMICRGetSectionCount (DocInfo, §ionCount) ==MICR_ST_OK) {
for (sectionIndex = 0; sectionIndex < sectionCount; sectionIndex) {
char SectionName [128];
DWORD SectionNameSize = 128;
dwStatus = MTMICRGetSectionName(DocInfo, sectionIndex, SectionName,
&SectionNameSize);
if (dwStatus == MICR_ST_OK)
{
// Display the section Name
DWORD keyCount;
if (MTMICRGetKeyCount (DocInfo, SectionName, &keyCount) == MICR_ST_OK){
// Display the key count
}
}
}
}
}