Example, Mtmicrgetkeycount – MagTek Excella STX99875340 User Manual
Page 47

Section 3. Excella API
37
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)
{
}
}
}
}
MTMICRGetKeyCount
MTMICRGetKeyCount function returns the number of keys that belong to a section with the name specified in variable
pcSection. The function MTMICRGetKeyCount parses through a null terminated string which contains a set of key/value
pairs. The key/value pairs get stored in the buffer using function MTMICRSetValue or MTMICRSetIndexValue.
ULONG MTMICRGetKeyCount (
char
*pcData,
char
*pcSection,
DWORD
*pdwKeyCount
);