VBCPPGuy
May 5th, 1999, 05:16 PM
Hello,
I am using a Rich Edit control on a dialog to display record information for
a simple record viewer used in a robots.txt generator I am writting in Visual C++ 6. I am
using the RichEdit control so I can make the field names (i.e. Bot Name:) a
different color from the rest of the text. Everything works as intended in
debug builds, but when I compile a release build all the text is black and
not the colors I specify. Here is part of the code I am using:
. . . some code precedes this...
CHARFORMAT cf;
COLORREF crFieldTitles = RGB(0,128,128);
COLORREF crNormalText = GetSysColor(COLOR_WINDOWTEXT);
iSel = m_BotList.GetCurSel();
if(iSel != LB_ERR)
{
iDBIndex = (int)m_BotList.GetItemData(iSel);
m_BotDatabase.GetRecord(iDBIndex);
m_RichBotInfo.GetDefaultCharFormat(cf);
cf.dwEffects = CFE_BOLD|TRUE;
m_RichBotInfo.SetWindowText("");
// Bot Name
cf.crTextColor = crFieldTitles;
m_RichBotInfo.SetWordCharFormat(cf);
m_RichBotInfo.ReplaceSel("Robot Name:");
cf.crTextColor = crNormalText;
m_RichBotInfo.SetWordCharFormat(cf);
m_RichBotInfo.ReplaceSel(" " + m_BotDatabase.m_strBotName);
... code goes on...
Thanks for any help,
Frank R.
I am using a Rich Edit control on a dialog to display record information for
a simple record viewer used in a robots.txt generator I am writting in Visual C++ 6. I am
using the RichEdit control so I can make the field names (i.e. Bot Name:) a
different color from the rest of the text. Everything works as intended in
debug builds, but when I compile a release build all the text is black and
not the colors I specify. Here is part of the code I am using:
. . . some code precedes this...
CHARFORMAT cf;
COLORREF crFieldTitles = RGB(0,128,128);
COLORREF crNormalText = GetSysColor(COLOR_WINDOWTEXT);
iSel = m_BotList.GetCurSel();
if(iSel != LB_ERR)
{
iDBIndex = (int)m_BotList.GetItemData(iSel);
m_BotDatabase.GetRecord(iDBIndex);
m_RichBotInfo.GetDefaultCharFormat(cf);
cf.dwEffects = CFE_BOLD|TRUE;
m_RichBotInfo.SetWindowText("");
// Bot Name
cf.crTextColor = crFieldTitles;
m_RichBotInfo.SetWordCharFormat(cf);
m_RichBotInfo.ReplaceSel("Robot Name:");
cf.crTextColor = crNormalText;
m_RichBotInfo.SetWordCharFormat(cf);
m_RichBotInfo.ReplaceSel(" " + m_BotDatabase.m_strBotName);
... code goes on...
Thanks for any help,
Frank R.