 |
CreateDC ..msdn Add comment W32 Constants Translate this page |
 |
 |
|
The CreateDC function creates a device context (DC) for a device using the specified name. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
HDC CreateDC(
LPCTSTR lpszDriver, // driver name
LPCTSTR lpszDevice, // device name
LPCTSTR lpszOutput, // not used; should be NULL
CONST DEVMODE* lpInitData // optional printer data
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER CreateDC IN gdi32;
STRING lpszDriver,;
STRING lpszDevice,;
INTEGER lpszOutput,;
INTEGER lpInitData
|
 |
 |
 |
| Parameters: |
 |
lpszDriver
For various Windows this parameter can be NULL, or can contain a null-terminated string.
lpszDevice
[in] Pointer to a null-terminated character string that specifies the name of the specific output device being used.
lpszOutput
This parameter is ignored for Win32-based applications, and should be set to NULL.
lpInitData
[in] Pointer to a DEVMODE structure containing device-specific initialization data for the device driver. |
 |
 |
| Return value: |
 |
If the function succeeds, the return value is the handle to a DC for the specified device. If the function fails, the return value is NULL.
|
 |
 |
| Usage: |
 |
* creating device context for a printer
hdc = CreateDC ("WINSPOOL",;
"\\PRNSERVER01\REMOTEPRINTER002", 0, 0)
|
 |
 |
| My comment: |
 |
| The W2K Programming: the first way to obtain a printer device context is to use CreateDC function. The second way is to call PrintDlgEx function, which displays the Print common dialog box that allows the user to set various printing options. |
 |
 |
| Word Index links for the CreateDC : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2001-09-14 12:00:00 | | Modified: | 2007-06-11 22:03:25 | Visited in last 7 days: 20 |