This function retrieves the number of elements in the array that will be returned when a supported item is retrieved from the printer specified by the printer name.
Parameters
Name | Explanation |
---|---|
PrinterName | The printer name |
CapNo | The type of item retrieved (0: Paper size, 1: Paper tray, 2: Resolution) |
Return Value
Returns the number of retrieved items. Returns 0 if unsuccessful.
Explanation
The IKPrintGetArrayNum function retrieves the number of elements in the array that will be returned when a supported item is retrieved from the printer specified by the printer name. The IKEnumPaperSizes, IKEnumPaperBins, and IKEnumResolutions functions pass arrays as parameters and the IKPrintGetArrayNum function can be used to find out how many elements are contained in those arrays.
Sample Code:
(1)C++Builder/Visual C++
int Size;
LPPOINT Resolutions;
Size := IKPrintGetArrayNum("EPSON LP-8200C", 2);
if (Size < 1) return;
Resolutions = (LPPOINT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(POINT) * Size);
__try {
IKEnumResolutions("EPSON LP-8200C", Resolutions);
// Enter your processing code here... ..
..........
..........
} __finally {
HeapFree(GetProcessHeap(), 0, Resolutions);
}
(2)Delphi
Size: Integer;
Resolutions: array of TPoint;
Size := IKPrintGetArrayNum('EPSON LP-8200C', 2);
if Size < 1 then Exit;
SetLength(Resolutions, Size);
IKEnumResolutions('EPSON LP-8200C', Resolutions[0]);
// Enter your processing code here... ..
..........
..........
(3)Visual Basic
Dim Size As Long
Dim Resolutions() As IKPOINT
Size = IKPrintGetArrayNum("EPSON LP-8200C", 2)
If Size < 1 Then Exit Sub
ReDim Resolutions(Size)
Call IKEnumResolutions("EPSON LP-8200C", Resolutions(0))
'Enter your processing code here... ..
..........
..........