I am accessing a MS Access database to get some information to show as a tooltip over a tree control.
There are 2 fields in particular that are causing some interesting effects on a CString variable. The field types are (in Access) Currency, and Memo. This issue only appears with these 2 fields.
Here is the code that has the issue:
An interesting thing happens when stepping through the code. When setting the description, the line:
sTipText += _T("\r\n Description: ") + strTemp;
Does not appear to do anything. On all other lines where sTipText gets concatenated with another string, it turns to red to show it's the value being worked with, however it doesn't on that line. It's like that line is being ignored.
However, if I just add some generic text over those 4 lines, instead of the data from the database, there is no issue.
Are there non-printable characters that would prevent concatenation to a CString variable that might be in the data and I can't tell?
Anyone have any suggestions?
There are 2 fields in particular that are causing some interesting effects on a CString variable. The field types are (in Access) Currency, and Memo. This issue only appears with these 2 fields.
Here is the code that has the issue:
Code:
CString strTemp;
// Plan Name
sTipText += _T(" Plan: ") + value;
// Minutes
cRS.GetFieldValue( (short)2, key );
strTemp.Format( _T("%d"), key.m_iVal );
key.Clear();
sTipText += _T("\r\n Minutes: ") + strTemp;
strTemp = _T("");
// Price
cRS.GetFieldValue( (short)3, strTemp );
strTemp.Replace(_T("00"), _T(""));
sTipText += _T("\r\n Price: ") + strTemp;
strTemp = _T("");
// Description
cRS.GetFieldValue( (short)4, strTemp );
strTemp.Replace(_T("&"), _T("and"));
sTipText += _T("\r\n Description: ") + strTemp;
strTemp = _T("");
data->SetToolTipString( sTipText );
CString sLength;
sLength.Format(_T("%d"), sTipText.GetLength() );
AfxMessageBox( sLength );
AfxMessageBox( sTipText );
An interesting thing happens when stepping through the code. When setting the description, the line:
sTipText += _T("\r\n Description: ") + strTemp;
Does not appear to do anything. On all other lines where sTipText gets concatenated with another string, it turns to red to show it's the value being worked with, however it doesn't on that line. It's like that line is being ignored.
However, if I just add some generic text over those 4 lines, instead of the data from the database, there is no issue.
Are there non-printable characters that would prevent concatenation to a CString variable that might be in the data and I can't tell?
Anyone have any suggestions?