VC++ Programming UESTC Chapter 5 The Graphics Device Interface Color and Fonts One-Stage construction: Construct and initialize the object in one stage, all with the constructor Two-stage construction: Construct and initialize the object in two separate stages. The constructor creates the object and an initialization function initializes it CFont and Crgn reqires a second initialization
VC++ Programming @ UESTC 11 One-stage construction: Construct and initialize the object in one stage, all with the constructor. Two-stage construction: Construct and initialize the object in two separate stages. The constructor creates the object and an initialization function initializes it. CFont and CRgn reqires a second initialization. Chapter 5 The Graphics Device Interface , Color and Fonts
VC++ Programming UESTC Chapter 5 The Graphics Device Interface Color and Fonts Destroy gdi object Failure to delete a gdi object is a serious problem The derived class destructor delete the windows gDi objects that are attached to the C++ objects To delete a gdi object first separate it from the device context Use CDC: SelectObjecto to disconnect GDI objects from the device context
VC++ Programming @ UESTC 12 ⚫ Destroy GDI object. Failure to delete a GDI object is a serious problem. The derived class destructor delete the Windows GDI objects that are attached to the C++ objects. To delete a GDI object, first separate it from the device context. Use CDC::SelectObject() to disconnect GDI objects from the device context. Chapter 5 The Graphics Device Interface , Color and Fonts