Dear Cedric, Thank you so much now I solved the proble but only one thing is pending. For instance, if the text has more no. of \r in it then how could I replace all the \r. Please give me your advice. I have done already for one occurance of \r and the code is below.
char *str = "abc\rxyz";
stdstr = str;
int idx = stdstr.find('\r');
stdstr.insert((idx+1),1,'\n');
const char* rcData = stdstr.c_str();
int lenA = lstrlenA(rcData);
int lenW;
wchar_t *unircData;
lenW = ::MultiByteToWideChar(CP_ACP,0,rcData,lenA,0,0);
unircData = SysAllocStringLen(0,lenW);
if(lenW >0)
{
::MultiByteToWideChar(CP_ACP,0,rcData,lenA,unircData,lenW);
}
unircData[lenW] = 0;
m_EDIT.ReplaceSel(unircData);