SetDlgItemText (hDlg, TEXT("SHOW"), szBuffer); 编译结果是: warning C4047: 'function' : 'int ' differs in levels of indirection from 'char [4]' warning C4024: 'GetDlgItemTextA' : different types for formal and actual parameter 2 warning C4047: 'function' : 'int ' differs in levels of indirection from 'char [5]' warning C4024: 'SetDlgItemTextA' : different types for formal and actual parameter 2 Linking...
用on_shift(小迷糊)这种方法OK不过加下面的说明 void CHelp_2Dlg::OnChangeEdit1() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialog::OnInitDialo() // function and call CRichEditCtrl().SetEventMask() // with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here UpdateData(true); m_Edit2 = m_Edit1; UpdateData(false);}
SetDlgItemText (hDlg, 第二个edit的ID, text);
在第一个edit的ENCHAGE消息响应里(具体的消息名字忘了),加上
UpdateData(TRUE);
m_editstr2 = m_editstr1;
UpdataData(FALSE);
即可。
GetDlgItemText (hDlg, TEXT("GET"), szBuffer, 20);
SetDlgItemText (hDlg, TEXT("SHOW"), szBuffer);
编译结果是:
warning C4047: 'function' : 'int ' differs in levels of indirection from 'char [4]'
warning C4024: 'GetDlgItemTextA' : different types for formal and actual parameter 2
warning C4047: 'function' : 'int ' differs in levels of indirection from 'char [5]'
warning C4024: 'SetDlgItemTextA' : different types for formal and actual parameter 2
Linking...
void CHelp_2Dlg::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialo()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData(true);
m_Edit2 = m_Edit1;
UpdateData(false);}