2 mtecsdk_opendevice, 3 mtecsdk_setlogfilehandle, Mtecsdk_opendevice – MagTek EC2000 99875713 User Manual
Page 11: Mtecsdk_setlogfilehandle, 2 - functions

2 - Functions
ExpressCard 2000| Instant Issuance Card Personalization System | Programmer’s Reference (Windows SDK)
Page 11 of 21
2.2 MTECSDK_OpenDevice
This function opens a communication channel with the device specified by pcDevName.
ULONG MTECSDK_OpenDevice (
char *pcDevName
);
Parameters:
pcDevName - Pointer to null-terminated string that specifies the name of the device to open. Use
function MTECSDK_GetDevice to obtain the device name.
Return Values:
If the function succeeds, the return value is EC_ST_OK.
EC_ST_OK
EC_ST_BAD_DEVICE_NAME
EC_ST_DEVICE_NOT_FOUND
EC_ST_DEVICE_NOT_RESPONDING
EC_ST_MSXML_NOT_FOUND
Remarks:
If the pcDevName is NULL, the return value is EC_ST_BAD_DEVICE_NAME.
If no device is found, the return value is EC_ST_DEVICE_NOT_FOUND.
If MSXML is not installed, return value is EC_ST_MSXML_NOT_FOUND
If device is found but cannot connect, return value is EC_ST_DEVICE_NOT_RESPONDING
Example:
#define DEVICE_NAME_LEN 128
int i=1;
DWORD dwResult;
char pcDevName[DEVICE_NAME_LEN]="";
while ((dwResult = MTECSDK_GetDevice(i,(char*) pcDevName)) !=
EC_ST_DEVICE_NOT_FOUND)
{
if (MTECSDK_OpenDevice (pcDevName) == EC_ST_OK)
{
///close the device
MTECSDK_CloseDevice (pcDevName);
}
i++;
}
2.3 MTECSDK_SetLogFileHandle
This function specifies a handle to a file where the SDK will log all messages and errors when logging is
enabled using MTECSDK_LogEnable. By default, there is no log file.
VOID MTECSDK_SetLogFileHandle (
HANDLE hFileHandle