EasyManua.ls Logo

ABLE Ap1400 - Page 28

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 28 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
DllInitialise
Initialise the USBPrint subsystem and LIBUSB drivers
Prototype
int WINAPI DllInitialise(void);
Description
This function prepares the LIBUSB subsystem and the USB bus for access. It loads
all necessary LIBUSB dll’s and initialises them. This function must be called once
only, prior to any other access of USBPrintDll functionality (except GetDllVersion).
In a foundation class application this call is best placed in the InitInstance function
of the CWinApp class.
Arguments
None
Returns
Integer value (0 or 1) to indicate success or failure, where 0 is a failure.
If a failure occurs then DllInitialise will display a dialog explaining the problem.
In addition, the system error code is set which can be retrieved by calling
GetLastError()
Example
//Initialise the Support DLL
if(DllInitialise())
{
//Declare & show main dialog
CUSBPrintTestDlg cUSBTestDlg(this);
m_pMainWnd=&cUSBTestDlg;
INT_PTR iResponse=cUSBTestDlg.DoModal();
//We are not bothered about the return
}
else
{
CString csError;
csError.Format(_T(“USBPrintDll failed to initialise. R/C=%d.”),
GetLastError());
AfxMessageBox(csError,MB_ICONSTOP|MB_OK);
}

Related product manuals