PtrDevice:CreatePrinterDC() Method

<< Click to Display Table of Contents >>

Navigation:  RpPrinter & PtrDevice Class Overview > PtrDevice Class >

PtrDevice:CreatePrinterDC() Method

Previous pageReturn to chapter overviewNext page

Purpose

To create a printer device context for use with Windows printing functions.

Syntax

<oPtrDevice>:CreatePrinterDC()  hDC                (16-bit: WORD, 32-bit: PTR)

Description

This method creates a printer device context based on information contained in the PtrDevice internal structures.  Use this method if you need to create a printer device context when printing is not in progress.  If printing or preview is in progress, the <oPtrDevice>:PrinterDeviceContext access will return the current printer device context.

 

You are responsible for calling the Windows function DeleteDC(hDC) when you are finished with this device context.

Example

// Create a printer device context

hDC := oPtrDevice:CreatePrinterDC()

... // go something with it

DeleteDC(hDC)