GetNumServerPrinters method

The number of server printers available is returned in the specified variable.

Method
short GetNumServerPrinters(
VARIANT * pNumServerPrinters )
Parameters
pNumServerPrinters
Points to a variable to receive the number of server printers available for the current server. On return, this variable is set to type VT_I2.
Description
This value can be used with the GetServerPrinter and GetServerPrinterInfo methods.
Return Value
Refer to return codes.
See Also
GetServerPrinter and GetServerPrinterInfo methods

C/C + +

The following example retrieves the names and attributes of the available server printers.
 CArsOle * pArsCtrl;

 short rc, j, num_prts;
 char name[ 200 ];
 VARIANT vari, type;
   .
   .
   .

 rc = pArsCtrl->GetNumServerPrinters( &vari );
 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;
 num_prts = vari.iVal;

 for ( j = 0; j < num_prts; j++ )
 {
   rc = pArsCtrl->GetServerPrinter( j, name, type );
   if ( rc != ARS_OLE_RC_SUCCESS )
     ERROR;

   // Process name and type

 }
   .
   .
   .

Visual Basic

 Dim rc, count As Integer
 Dim num_prts, type As Variant
 Dim name As String

  .
  .

 rc = ArsOle.GetNumServerPrinters (num_prts)
 If rc <> ARS_OLE_RC_SUCCESS Then
    MsgBox "ERROR"
    End
 End If

 For count = 0 To num_prts -1
    rc = ArsOle.GetServerPrinterInfo (count, name, type)
    ' Process name and type
 Next count

  .
  .