Just as pointed by Zodiaq, if I use an statically allocated static array of COLORREFS (;static COLORREF rgbCust[16];etc) instead a dinamically allocated pointer the problem I mentioned dissappears. Thanks.