beautypg.com

Mcpwait, Parameters, Mcpwait function to i – MagTek MAGTEK User Manual

Page 73

background image

Section 5. Application Programmable Interface


67

McpWait

This function is used to get the next notification which the device has sent. When notifications
are received from a device, they are queued for subsequent retrieval by the host application using
this function.


DWORD McpWait( HANDLE hDevice, PMCPBUS pMCPBUS );

Parameters

hDevice


Handle to the specified device (communications resource) for notifications. This handle was
returned from the McpOpen function.

pMCPBUS


Pointer to the MCPBUS structure used by the MCP API function to perform this operation.
The following structure members are used as input parameters.

Member

Meaning

dwOperAttribute

MCP_ATTR_NONE

- do not discard buffered notifications

MCP_ATTR_WAIT_NEW - discard

all

buffered notifications; wait for

the next new notification from the device

dwTimeout

Timeout value for notification to arrive:

-1 Return immediately with next notification if one is buffered or wait
indefinitely for the next one to arrive from the device.

=0 Return immediately with next buffered notification or error if no
notifications are buffered. Note: MCP_ATTR_WAIT_NEW should not be
set if specifying this value for the timeout.

>0 Return immediately with the next notification if one is buffered or wait
this number of milliseconds for the next one to arrive.

lpOutBuffer

Pointer to storage buffer to receive notification information

dwOutBufferSize

Size (in bytes) of storage buffer pointed to by lpOutBuffer