to wolf721():
"GetDlgItem(IDC_EDITFEIOTHER)->SetWindowText(str);"取的是"CBarCode::OnBTNDETAILOther"所在的dialog中的IDC_EDITFEIOTHER,跟"CTollDetailMed dlg;"没关系了。
1、在CTollDetailMed类中增加一个成员char *m_p; 在构造函数增加一个参数;
CTollDetailMed::CTollDetailMed(char *p){m_p=p;...};
2、将
void CBarCode::OnBTNDETAILOther()
{
// TODO: Add your control notification handler code here
CTollDetailMed dlg;
int ret = dlg.DoModal();
改为
void CBarCode::OnBTNDETAILOther()
{
// TODO: Add your control notification handler code here
char buff[100];
CTollDetailMed dlg(&buff);
int ret = dlg.DoModal();
....
}
3、在CTollDetailMed的OnOK();中将需要保存得值 copy到*m_p中(有多项可以存放在*m_p中不同的位置或按一定的分割符串起来,也可以定义一个结构传递给CTollDetailMed);