Help and Support

PRB: DoSuperclassPaint Calls WM_PRINT for Windows 95

Article ID:147426
Last Review:November 21, 2006
Revision:2.1
This article was previously published under Q147426

SYMPTOMS

In some cases, you may need to take a window's custom control and subclass it with an OLE control. However, when the control is built using MFC 4.0 and being used in Windows 95, the OLE control may paint incorrectly.

Back to the top

CAUSE

A typical OnDraw() handler in an OLE control that subclasses a window's custom control makes a call to DoSuperclassPaint(). In Windows 95, The MFC 4.0 implementation of DoSuperClassPaint() has been changed to send a WM_PRINT message to the custom control's window procedure instead of a WM_PAINT message. If the original custom control does not handle WM_PRINT, the OLE control will not paint correctly.

Back to the top

RESOLUTION

It is necessary for the original custom control to handle the WM_PRINTCLIENT message, which is what the DefWindowProc sends in response to receiving a WM_PRINT message. The WM_PRINTCLIENT message should be handled in the same manner as the WM_PAINT message except that the calls to BeginPaint() and EndPaint() should be removed.

Back to the top

STATUS

This behavior is by design.

Back to the top


APPLIES TO
Microsoft Foundation Class Library 4.2, when used with:
  Microsoft Visual C++ 4.0 Professional Edition
  Microsoft Visual C++ 5.0 Learning Edition

Back to the top

Keywords: 
kbctrl kbprb KB147426

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.