Help and Support

PRB: ActiveX Control Painting Problems in Visual C++ 4.2

Article ID:154166
Last Review:December 1, 2003
Revision:2.0
This article was previously published under Q154166
On This Page

SYMPTOMS

The ActiveX (OLE) Control may not paint correctly if it was built using Visual C++ 4.2. Two known issues include controls not repainting when resized, and control child windows not being repainted. Other painting problems have been observed when subclassing native Windows controls.

Back to the top

CAUSE

This behavior is caused by changes to COleControl::OnPaint which add optimizations to improve performance.

Back to the top

RESOLUTION

COleControl now includes a method, GetControlFlags, to control how painting will be handled in an ActiveX control. Removing the fastBeginPaint flag from the bit field returned by GetControlFlags will cause your ActiveX control to use the same OnPaint code found in Visual C++ 4.1

Back to the top

STATUS

This behavior is by design.

Back to the top

MORE INFORMATION

Sample Code

DWORD CMyOleControl::GetControlFlags ()
{
   return COleControl::GetControlFlags() & ~fastBeginPaint;
}
				

Back to the top

REFERENCES

For an explanation of the GetControlFlags return values, see the documentation in Books on Line.

Back to the top


APPLIES TO
Microsoft Visual C++ 4.2 Enterprise Edition
Microsoft Visual C++ 5.0 Enterprise Edition
Microsoft Visual C++ 4.2 Professional Edition
Microsoft Visual C++ 5.0 Professional Edition

Back to the top

Keywords: 
kbnoupdate kbprb KB154166

Back to the top

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.