beautypg.com

Mtmicrclosedevice, Parameters, Return values – MagTek Excella Windows API99875313 User Manual

Page 25: Example

background image

Section 3. Excella API


17

MTMICRCloseDevice


MTMICRCloseDevice
function closes the device with the given device name.

ULONG MTMICRCloseDevice (

char

*pcDevName

);

Parameters


pcDevName

Pointer to null terminated string containing the name of the device to close. This is the

device that is

previously

opened using function MTMICROpenDevice.

Return Values


MICR_ST_OK
MICR_ST_BAD_PARAMETER
MICR_ST_DEVICE_NOT_FOUND

Example


#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN]="";

// Get the device name at device number “i”
while ((dwResult = MTMICRGetDevice(i,(char*) pcDevName)) != MICR_ST_DEVICE_NOT_FOUND)
{

// Success in getting the device name


// Open this device
if (MTMICROpenDevice (pcDevName) == MICR_ST_OK)
{

// Now close this device
MTMICRCloseDevice (pcDevName);

}
else
{

// Error while opening this device.

}

i++;

}