Hi,

I'm having access violation problems with CString. Checking the boards, I discovered that I do not suffer alone. A solution recommended was to type cast to LPCTSTR before assigning the new CString value.

I'm still getting access violation problems, though in a new spot. It now appears in the red-line in the following code.

void CString::AssignCopy(int nSrcLen, LPCTSTR lpszSrcData)
{
AllocBeforeWrite(nSrcLen);
memcpy(m_pchData, lpszSrcData, nSrcLen*sizeof(TCHAR));
GetData()->nDataLength = nSrcLen;
m_pchData[nSrcLen] = '\0';
}

The strange thing is, that both before and after the memcpy, the m_pchData points to garbage. I did initialize it.

Hope this info isn't too vague. Hope someone else has suffered through similar problems and has an idea.

Mat.