BUG: Stock Color Property Page Does Not Change Colors for More than Two Controls
ID: Q234524
|
The information in this article applies to:
-
Microsoft Visual Studio 6.0
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 this to be a bug in the Microsoft products listed
at the beginning of this article.
MORE INFORMATION
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.
- Select all four controls. A rectangle should appear around each one.
- Select the Edit/Properties menu item.
- Change the BackColor property to a different color. Be sure to select a color from the Standard Colors set.
- Click Apply.
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 : kbCOMt kbCtrlCreate kbVS600bug kbGrpMFCATL
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug