Microsoft KB Archive/234524

= BUG: Stock Color Property Page Does Not Change Colors for More than Two Controls =

Article ID: 234524

Article Last Modified on 8/15/2005

-

APPLIES TO


 * Microsoft Visual Studio 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q234524



SYMPTOMS
When using the Stock Color Property Page provided in Msstkprp.dll for more than two controls, colors will not be changed for all selected controls. It will only change a maximum of two controls at one time.



CAUSE
This is due to a bug in the internal implementation of the Stock Color Property Page.



RESOLUTION
To work around this problem, select only one or two controls at a time when you want to change the color of a property.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Using Visual C++ 6.0, create a new ATL project via the ATL COM AppWizard. Pick DLL as the Server Type and leave the rest of the options unchanged. Insert a new Full Control from the Insert/New ATL Object menu. Be sure to add support for the Backcolor Stock Property from the Stock Properties Page.  Change the OnDraw code for the generated control to the following: HRESULT OnDraw(ATL_DRAWINFO& di) {           RECT& rc = *(RECT*)di.prcBounds; HBRUSH hbr = CreateSolidBrush(m_clrBackColor); FillRect(di.hdcDraw, (const RECT*) di.prcBounds, hbr); DeleteObject(hbr);

SetTextAlign(di.hdcDraw, TA_CENTER|TA_BASELINE); LPCTSTR pszText = _T("ATL 3.0 : StockReproTest"); TextOut(di.hdcDraw,                (rc.left + rc.right) / 2,                 (rc.top + rc.bottom) / 2,                 pszText,                 lstrlen(pszText));

return S_OK; }                    Build the ATL project. Insert four copies of the control into the ActiveX Control Test Container.</li> Select all four controls. A rectangle should appear around each one.</li> Select the Edit/Properties menu item.</li> Change the BackColor property to a different color. Be sure to select a color from the Standard Colors set.</li> Click Apply.</li></ol>

You should notice that only two of the four controls changed color though you would have expected all of them to change.

Additional query words: ATL Stock Property Page Color VB design time

Keywords: kbbug kbctrlcreate kbpending KB234524

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.