S
Safiullah
Guest
I have the Following code running:
strBlockText = "AND";
CString string(strBlockText.c_str());
arg_pDC->SetTextColor(RGB(0, 0, 0));
arg_pDC->SetTextAlign(TA_LEFT | TA_TOP);
arg_pDC->MoveTo(arg_ptOrigin + CPoint(3, 3));
arg_pDC->DrawText(string, &objBlockRect, 0);
This prints correctly in the desired location.
However, when I change the string to something like this:
strBlockText = "A&D";
CString string(strBlockText.c_str());
arg_pDC->SetTextColor(RGB(0, 0, 0));
arg_pDC->SetTextAlign(TA_LEFT | TA_TOP);
arg_pDC->MoveTo(arg_ptOrigin + CPoint(3, 3));
arg_pDC->DrawText(string, &objBlockRect, 0);
The '&' gets ignored and I only get AD.
Do I need to use an escape character for &?
Continue reading...
strBlockText = "AND";
CString string(strBlockText.c_str());
arg_pDC->SetTextColor(RGB(0, 0, 0));
arg_pDC->SetTextAlign(TA_LEFT | TA_TOP);
arg_pDC->MoveTo(arg_ptOrigin + CPoint(3, 3));
arg_pDC->DrawText(string, &objBlockRect, 0);
This prints correctly in the desired location.
However, when I change the string to something like this:
strBlockText = "A&D";
CString string(strBlockText.c_str());
arg_pDC->SetTextColor(RGB(0, 0, 0));
arg_pDC->SetTextAlign(TA_LEFT | TA_TOP);
arg_pDC->MoveTo(arg_ptOrigin + CPoint(3, 3));
arg_pDC->DrawText(string, &objBlockRect, 0);
The '&' gets ignored and I only get AD.
Do I need to use an escape character for &?
Continue reading...