I have a compilation error when i transfered from VS 6.0 to VS 2005. This is the error 7 error C3861: 'AssignCopy': identifier not found c:\dev\commonfiles\myclasses.h 95. when i was given this program 2 make the necessary changes i was told that AssignCopy was in a predefined copy class and this is it #include "afxmt.h". Any help would be appreciated.
Thanxx

changing from VS 6.0 to VS 2005
Dennis Persson
Chris Kurz
It seems that you have a class which derives from CString, and that class uses the AssignCopy inherited protected function.
In new MFC there is no more such a function.
If you find such a class (probably in your "myclasses.h" file) where the AssignCopy is used, you can define here your own function which simulates missing AssignCopy, maybe like this:
class YourClass : public CString
{
// . . .
protected:
void AssignCopy(int nSrcLen, LPCTSTR lpszSrcData)
{
Empty();
Append(lpszSrcData, nSrcLen);
}
};
Hope it helps.
Vasen_c
Please include more details as well as a code sample reproducing the issue.
Thanks, Ayman Shoukry VC++ TeamKrzysztof Radzimski
CUnderscoreInName(CString& stringSrc)
{
// ACTUAL COPY NECESSARY SINCE ONE OF THE STRINGS IS LOCKEDAssignCopy(stringSrc.GetLength(), stringSrc.GetBuffer(0));
stringSrc.ReleaseBuffer(-1);
}
This is the block of code that gets me the error. I was reading things on the net about how when converting to VS 2005 how the classes change and u may need to change the class that is included but if that's the problem i don't know what 2 change it 2. My manager isn't here right now so this is the best block of code that i can give u that i know wont get me in trouble.