//USERLIST 为一个结构体,CSendMsgDlg为子窗口类
struct USERLIST
{
int nIndex;
CString strMsg;
CSendMsgDlg *pSMDlg;
USERLIST *pNext;
};//建立USERLIST 链表(略),m_pListHead为链表的链首
//m_strRecv为子对话框与一Edit关联的变量
//主对话框想要在一非模式对话框中的一个EDIT显示一些内容
//如果子对话框存在,则直接显示,如果不存在,则先建立子对话框后显示USERLIST *pList;
for(pList = m_pListHead;pList;pList = pList->pNext)
{
if(pList->nIndex == lParam)
{
if(pList->pSMDlg == NULL)
{
pList->pSMDlg = new CSendMsgDlg(this);
pList->pSMDlg->Create(CSendMsgDlg::IDD,this);
pList->pSMDlg->ShowWindow(SW_SHOW); 
pList->pSMDlg->SetWindowText(pList->strID);
                           pList->strMsg = "Test";
}
else
pList->pSMDlg->SetFocus();
}
}
pList->pSMDlg->m_strRecv = pList->strMsg;//错误
UpdateData(FALSE);
或 pList->pSMDlg->SendMessage(WM_SMDLG_SHOWMSG,0,(LPARAM)&(pList->strMsg));//错误为什么最后两句会出错呢?
主对话框想要在一非模式对话框中的一个EDIT显示一些内容,该怎么做?