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.

[C++Builder]     int IKPrintGetArrayNum(LPCTSTR PrinterName, short CapNo);
[Delphi]         function IKPrintGetArrayNum(PrinterName: PChar; CapNo: Smallint): Integer;

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

   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... ..
       ..........
       ..........

 

The ImageKit10 VCL is a product created by Newtone Corporation