Example, Mtmicrdevicedisconnect, Parameters – MagTek Excella STX99875340 User Manual

Page 29: Return values, Remarks

Advertising
background image

Section 3. Excella API

19

Example


char logString[256];
DWORD dwStatus;

dwStatus = MTMICRDeviceConnect(“192.168.10.100”,

INTERNET_DEFAULT_HTTP_PORT,

INTERNET_OPEN_TYPE_DIRECT,

“ProxyServer”,

“ProxyByPassIP”);

if(dwStatus!=MICR_ST_OK)

{

sprintf (logString, "Opening Device FAILED - ERROR %d", dwStatus);

MessageBox (logString, "Demo", MB_OK);

}

MTMICRDeviceDisconnect


MTMICRDeviceDisconnect
function disconnects the device that has the given IP address or DNS name.

ULONG MTMICRDeviceDisconnect (LPSTR lpszDevice);

Parameters

lpszDevice Pointer to a null terminated string that contains the IP address or DNS name of the device. This is the

device

that is

previously connected using function MTMICRDeviceConnect.

Return Values


MICR_ST_OK
MICR_ST_BAD_DEVICE_IP_OR_DOMAIN_NAME
MICR_ST_DEVICE_NOT_FOUND
MICR_ST_BAD_DEVICE_IP_OR_DOMAIN_NAME

Remarks


If the parameter lpszDevice is NULL, the return value is MICR_ST_BAD_DEVICE_IP_OR_DOMAIN_NAME.

Example


char logString[256];
DWORD dwStatus;

dwStatus = MTMICRDeviceDisconnect(“192.168.10.100”);

if(dwStatus!=MICR_ST_OK)

{

sprintf( logString, "CANNOT CLOSE DEVICE - ERROR %d", dwStatus);

MessageBox (logString, "Demo", MB_OK);


}

Advertising