beautypg.com

Section 3. excella api, Mtmicrgetdevice, Parmeters – MagTek Excella Windows API99875313 User Manual

Page 23: Return values, Remarks, Example

background image

15

SECTION 3. EXCELLA API

MTMICRGetDevice


MTMICRGetDevice function returns the device name of the device present in the system.

ULONG MTMICRGetDevice (

DWORD

dwDeviceContext,

char

*pcDevName

);

Parmeters


dwDeviceContext

This is the device number of the device. This must be set to 1 to get the first device in the system. Increment it
by 1 to get the next device name.

pcDevName

Pointer to the buffer where the device name will be stored.

Return Values


MICR_ST_OK
MICR_ST_DEVICE_NOT_FOUND
MICR_ST_BAD_PARAMETER

Remarks


If the function succeeds, the return value is MICR_ST_OK. The device name of the device is filled in the buffer
pointed by the parameter pcDevName.

If there is no device present or there is no device that is associated with the given dwDeviceContext, then the
function fails and MICR_ST_DEVICE_NOT_FOUND is returned.

If there is no memory allocated for the pcDevName parameter, then MICR_ST_BAD_PARAMETER is returned.

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)
{

// Device found, increment the device number

i++;

}