Skip to content

Latest commit

 

History

History
22 lines (16 loc) · 1.39 KB

using-an-unclipped-device-context.md

File metadata and controls

22 lines (16 loc) · 1.39 KB
description title ms.date helpviewer_keywords ms.assetid
Learn more about: Using an Unclipped Device Context
Using an Unclipped Device Context
11/04/2016
MFC ActiveX controls [MFC], unclipped device context
9c020063-73da-4803-bf7b-2e1fd950c9ed

Using an Unclipped Device Context

If you are absolutely certain that your control does not paint outside its client rectangle, you can realize a small but detectable speed gain by disabling the call to IntersectClipRect that is made by COleControl. To do this, remove the clipPaintDC flag from the set of flags returned by COleControl::GetControlFlags. For example:

[!code-cppNVC_MFC_AxOpt#5] [!code-cppNVC_MFC_AxOpt#14] [!code-cppNVC_MFC_AxOpt#7]

The code to remove this flag is automatically generated if you select the Unclipped Device Context option on the Control Settings page, when creating your control with the MFC ActiveX Control Wizard.

If you are using windowless activation, this optimization has no effect.

See also

MFC ActiveX Controls: Optimization