CreateDC

  HDC CreateDC(lpszDriver, lpszDevice, lpszOutput, lpInitData)    
  LPCSTR lpszDriver;    
  LPCSTR lpszDevice;    
  LPCSTR lpszOutput;    
  CONST DEVMODE *lpInitData;    

The CreateDC function creates a device context for the specified device. The lpszDriver, lpszDevice, and lpszOutput parameters specify the device driver, device name, and physical output medium (file or port), respectively.

Parameters

lpszDriver

Points to a null-terminated character string that specifies the name of the device driver (for example, “Epson”).

lpszDevice

Points to a null-terminated character string that specifies the name of the specific device to be supported (for example, “Epson FX-80”). The lpszDevice parameter is used if the device driver supports more than one device.

lpszOutput

Points to a null-terminated character string that specifies the file or device name for the physical output medium (file or output port).

lpInitData

Points to a DEVMODE structure containing device-specific initialization data for the device driver. The ExtDeviceModeEx retrieves this structure filled in for a given device. The lpInitData parameter must be NULL if the device driver is to use the default initialization (if any) specified by the user through the Control Panel.

Return Value

The return value identifies a device context for the specified device if the function is successful. Otherwise, it is 0.

See Also

ExtDeviceModeEx