Mtmicropendevice – MagTek IMAGESAFE99875500 User Manual
Page 16

ImageSafe Windows API Specifications
8
MTMICROpenDevice
MTMICROpenDevice function opens the device with the given device name.
ULONG MTMICROpenDevice (
char
*pcDevName
);
Parameters
pcDevNam
Pointer to null terminated string that specifies the name of the device to open. Use function MTMICRGetDevice to
obtain the device name.
e
Return Values
If the function succeeds, the return value is MICR_ST_OK.
MICR_ST_OK
MICR_ST_BAD_DEVICE_NAME
MICR_ST_DEVICE_NOT_FOUND
MICR_ST_DEVICE_NOT_RESPONDING
MICR_ST_MSXML_NOT_FOUND
MICR_ST_MSXML_FAILED
Remarks
If the pcDevName is NULL, the return value is MICR_ST_BAD_DEVICE_NAME.
If no device is found, the return value is MICR_ST_DEVICE_NOT_FOUND.
If MSXML is not installed, return value is MICR_ST_MSXML_NOT_FOUND
If MSXML cannot be instantiated, return value is MICR_ST_MSXML_FAILED
If device is found but cannot connect, return value is MICR_ST_DEVICE_NOT_RESPONDING
Example
#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN]="";
while ((dwResult = MTMICRGetDevice(i,(char*) pcDevName)) != MICR_ST_DEVICE_NOT_FOUND)
{
if (MTMICROpenDevice (pcDevName) == MICR_ST_OK)
{
///close the device
MTMICRCloseDevice (pcDevName);
}
i++;
}