GET_PRINTERS command
Content Manager OnDemand returns a list of the available printers, either Local or Server printers as indicated by the parameter.
Command | Parameters |
---|---|
GET_PRINTERS | /L /S |
- Parameters
- L
- Indicates that a list of Local printers is to be returned. This parameter is optional, but either this or the S parameter must be specified.
- S
- Indicates that a list of Server printers is to be returned. This parameter is optional, but either this or the L parameter must be specified.
- Action
- None
- Return Code
-
- 0
ARS_DDE_RC_NO_ERROR
- 2
ARS_DDE_RC_PARM_NOT_SPECIFIED
- 6
ARS_DDE_RC_NOT_LOGGED_ON
- 11
ARS_DDE_RC_USER_ACTION_IN_PROGRESS
- Return Data
- If both parameters are specified, the results are unpredictable. The list is a null-terminated character string with the tab character separating each printer name.
Refer to the DoDdeCommand function.
char
data[1000], local_printers[10][100], * pToken;
int j;
if ( DoDdeCommand( "GET_PRINTERS", "/L", data ) )
{
for ( pToken = strtok( data, "\t" ), j = 0;
pToken != NULL &&;amp; j < 10;
pToken = strtok( NULL, "\t" ), j++ )
{
strcpy( local_printers[j], pToken );
}
}