void CChat_simulate_cView::OnBNSend()
{
CChat_simulate_cDoc* pDoc = GetDocument(); ChatInfo* pInfo = new ChatInfo;
CString szStrTmp; UpdateData(TRUE); m_Send_Content.GetWindowText(pInfo->m_Content); pInfo->m_New = 1; m_Self_ID.GetWindowText(szStrTmp);
pInfo->m_WhoSend = szStrTmp; m_Dest_ID.GetWindowText(szStrTmp);
pInfo->m_WhoRecive = szStrTmp; int szSize = pDoc->m_CurrentChatPersorn->m_MapUserChatInfo.size();
pDoc->m_CurrentChatPersorn->m_MapUserChatInfo[szSize] = pInfo;
......................................
}
各位大哥好!上面m_Send_Content,m_Self_ID,m_Dest_ID都是一个编辑框的CEdit类成员变量,可调试时,下面三个语句:
m_Send_Content.GetWindowText(pInfo->m_Content);
m_Self_ID.GetWindowText(szStrTmp);
m_Dest_ID.GetWindowText(szStrTmp);
不能把自己的内容写入szStrTmp中!甚至,于此时,连m_Send_Content等都处于:
CXXX0030:error:expression can not be evaluated 状态!谢谢大家能帮我指点一二!谢谢!
{
CChat_simulate_cDoc* pDoc = GetDocument(); ChatInfo* pInfo = new ChatInfo;
CString szStrTmp; UpdateData(TRUE); m_Send_Content.GetWindowText(pInfo->m_Content); pInfo->m_New = 1; m_Self_ID.GetWindowText(szStrTmp);
pInfo->m_WhoSend = szStrTmp; m_Dest_ID.GetWindowText(szStrTmp);
pInfo->m_WhoRecive = szStrTmp; int szSize = pDoc->m_CurrentChatPersorn->m_MapUserChatInfo.size();
pDoc->m_CurrentChatPersorn->m_MapUserChatInfo[szSize] = pInfo;
......................................
}
各位大哥好!上面m_Send_Content,m_Self_ID,m_Dest_ID都是一个编辑框的CEdit类成员变量,可调试时,下面三个语句:
m_Send_Content.GetWindowText(pInfo->m_Content);
m_Self_ID.GetWindowText(szStrTmp);
m_Dest_ID.GetWindowText(szStrTmp);
不能把自己的内容写入szStrTmp中!甚至,于此时,连m_Send_Content等都处于:
CXXX0030:error:expression can not be evaluated 状态!谢谢大家能帮我指点一二!谢谢!
看代码不像有错,建议你查查别得地方
CEdit *p = (CEdit *)GetDlgItem(CEdit控件的ID);
p->GetWindowText(szStrTmp);
CEdit *p = (CEdit *) GetDlgItem(CEdit控件ID);
p->GetWindowText(szStrTmp);
lsq004.myrice.com
typedef struct _ChatInfo
{
int m_Serial;
int m_New;
CString m_datetime;
CString m_WhoSend;
CString m_WhoRecive;
CString m_Content;}ChatInfo;m_Send_Content用跟踪显示是:
CXXX0030:error:expression can not be evaluated ,这说明它无效吧?它的值连vc环境都不能evaluated了!
ChatInfo变量经过上述的赋值后,也全部原封不动的显示:CXXX0030:error:expression can not be evaluated,赋值不成功!
用这种办法试试,看有没有出错:CEdit *p = (CEdit *)GetDlgItem(CEdit控件的ID);
p->GetWindowText(pInfo->m_Content);
m_Send_Contect为CEdit类型:
......
DDX_Control(ID, m_Send_Content);
......
我试了下:
CEdit *p = (CEdit *)GetDlgItem(CEdit控件的ID);
p->GetWindowText(pInfo->m_Content);
可仍一样:可能是其他哪里出了问题吧!
[email protected]
Attatch并未替换窗口过程,适合简单操作
{
CChat_simulate_cDoc* pDoc = GetDocument();
DDX_Text(pDX,ControlID,pDoc->m_strSomeMember);