Share via


Using an Unclipped Device Context

OverviewHow Do IFAQSample

If you are absolutely certain that your control doesn’t 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 . For example:

DWORD CMyCtrl::GetControlFlags()
{
    return COleControl::GetControlFlags() & ~clipPaintDC;
}

The code to remove this flag is automatically generated if you select the  Unclipped Device Context option on the Advanced ActiveX Features page, when creating your control with ControlWizard.

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