CString Replace doesnt work
Posted on 2006-05-20
I'm writing a program that reads a text in unix format (only \n) and then saves it again in unix format.
Now, so that my program can display it correctly I insert a \r before every \n.
But when I try to save it again, I want to remove those \r again.
I'm using an CString but Replace doesnt work somehow:
I tried several versions but none works
It also doesnt work when I try to replace a with b...
the var is filled here:
GetDlgItemText(hWnd, EDT_MESSAGE, statusMessage.GetBuffer(msgLen), msgLen + 1);
Also, when I tried to get the return value of the replace, it wouldnt give me anything, my declared variable wasnt even listed in the locals panel.
Btw, this stuff is all done in the MessageHandling function.
Can anyone help?