Compartilhar via


COleControl::TranslateColor

Converts a color value from the OLE_COLOR data type to the COLORREF data type.

COLORREF TranslateColor( 
   OLE_COLOR clrColor, 
   HPALETTE hpal = NULL  
);

Parameters

  • clrColor
    A OLE_COLOR data type. For more information, see the Windows OleTranslateColor function.

  • hpal
    A handle to an optional palette; can be NULL.

Return Value

An RGB (red, green, blue) 32-bit color value that defines the solid color closest to the clrColor value that the device can represent.

Remarks

This function is useful to translate the stock ForeColor and BackColor properties to COLORREF types used by CDC member functions.

Requirements

Header: afxctl.h

See Also

Reference

COleControl Class

Hierarchy Chart

COleControl::GetForeColor

COleControl::GetBackColor