EasyManua.ls Logo

ABLE Ap1400 - Page 36

ABLE Ap1400
42 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Ref: "Ap1400ProgGuide1_2.docx" Page 36 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
CloseDevice
Closes and releases a device and assoc
iated handle
Prototype
int WINAPI CloseDevice(int *pHandle);
Description.
Closes a device and releases the resources associated with the device. Once
closed the handle is invalidated and should be discarded.
Arguments
phandle – Pointer to the handle of an open device. This handle must have been
issued by a previous call to OpenDevice.
Returns
ERROR_SUCCESS if successfully closed, otherwise the value is set to the system
error code.
Example
//Check range prior to call
if(CloseDevice(&ihandle)!=ERROR_SUCCESS)
{
CString csError;
csError.Format(_T(“Close device failed. R/C=%d.”),
GetLastError());
AfxMessageBox(csError,MB_ICONSTOP|MB_OK);
return;
}
//Device has been successfully closed
TRACE(_T(“Device close success. \n”));

Related product manuals