|
||
void printer_get_name_s ( char *buffer, int buffer_len )
char *bufffer; // Character buffer that will contain printer name int buffer_len; // Length of the buffer in characters
|
|
|||
Synopsis |
#include "silver.h"
The printer_get_name_s function obtains a name for the currently selected Windows printer. This name may be saved and used in a subsequent call to printer_set_name. |
|
||
Parameters |
buffer is a character buffer which is to receive the printer name. buffer_len is the length of the character buffer |
|
||
Return Value |
printer_get_name_s returns -2 if the buffer is too small to hold the device name, -1 if a current printer could not be obtained (i.e. perhaps none is selected), and a number > 0 which is the length of the printer name. |
|
||
Remarks |
To determine the minimal buffer size, call printer_get_name_s with buffer = NULL, and/or buffer_len = 0. If the buffer is too small to hold the printer name, then buffer is not modified. |
|
||
See Also |
|
|||
Example |
The following example demonstrates how to use printer_get_name_s to obtain a buffer size, then how to call it again with an appropriately-sized buffer.
|
|