从对话框上获得到CString数据传值给另一个类的成员变量!为什么会出现这样的错误?
g_ServerConnect->GetUserInfo(m_Uid,m_UserName,m_PassWord);// 这里有问题
m_Uid,m_UserName,m_PassWord 这3个变量是和控件相关的
void CServerConnector::GetUserInfo(CString Uid, CString UserName, CString PW)
{
m_Uid = Uid;
m_UserName = UserName;
m_PassWord = PW;
}
单步调试的时候 程序会跳到这里来
const CString& CString::operator=(const CString& stringSrc)
{
if (m_pchData != stringSrc.m_pchData)
{
if ((GetData()->nRefs < 0 && GetData() != _afxDataNil) ||
stringSrc.GetData()->nRefs < 0)
{
// actual copy necessary since one of the strings is locked
AssignCopy(stringSrc.GetData()->nDataLength, stringSrc.m_pchData);
}
else
{
// can just copy references around
Release();
ASSERT(stringSrc.GetData() != _afxDataNil);
m_pchData = stringSrc.m_pchData;
InterlockedIncrement(&GetData()->nRefs);
}
}
return *this;
}