EasyManua.ls Logo

ABLE Ap1400 - Page 32

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 32 of 42
Document Revision: “1.2”
Document Date: “9 Apr. 2013”
GetVendor
Gets the vendor ID of an enume
rated device
Prototype
DWORD WINAPI GetVendor(int iIndex);
Description
Retrieves the vendor id of the device as a doubleword value. Vendor Id’s are
specific to usb device manufactures and can be used in the identification of a
device.
A call to EnumPrinters must have been made prior to calling this function
Arguments
iIndex – The index of the device. This must be an integer value
>=0<GetEnumPrinterCount();
If this value is outside of this range then an exception will be thrown.
Returns
DWORD representing the vendor id. The system error code will be set to
ERROR_SUCCESS regardless of whether the vendor id is valid or not.
Example
//Check range prior to call
if(iDevIndex>=0&&iDevIndex< GetEnumPrinterCount)
{
DWORD dwVendorID=GetVendor(iDevIndex);
//Display results
TRACE(_T(“Vendor ID for device index %d is %04X.\n”),
iDevIndex,dwVendorID);
}

Related product manuals