OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Constructing and Destroying TDC

TDC provides one public constructor and one public destructor.

The public constructor takes an HDC, a handle to a device context. Essentially this means that you must have an existing device context before constructing a TDC object. Usually you do not construct a TDC directly, even though you can. Instead you usually use a TDC object when passing some device context as a function parameter or a pointer to a TDC to point to some device context contained in either a TDC or TDC-derived object.

The destructor ~TDC restores all the default objects in the device context and discards the objects.

TDC also provides two protected constructors for use by derived classes. The first is a default constructor so that derived classes do not have to explicitly call TDC's constructor. The second takes an HDC and a TDC::TAutoDelete flag. TAutoDelete is an enum that can be NoAutoDelete or AutoDelete. The TAutoDelete parameter is used to initialize the ShouldDelete member, which is inherited from TGdiObject (the public TDC constructor initializes this to NoAutoDelete).

See Also