Q:

How to update data on another dialog MFC, I could find the answer from the Q&A records

I have my main Dialog and another dialog (which can be opened or called in the main dialog).
And I would like to update the data in the second dialog.
This is my code:
void CListManager::GetDataFromDb(int nMoveRecord)
{
    switch(nMoveRecord){
        case MOVE_PREV_RECORD:
            m_nMoveCount--;
            m_command.MovePrev();
            break;
        case MOVE_NEXT_RECORD:
            m_nMoveCount++;
            m_command.MoveNext();
            break;
        case 3: // Initial Start -> Last Contract
            m_command.MoveLast();
            break;

    }

    m_strE1 = m_command.GetString(1);
    m_strE2 = m_command.GetString(2);
    m_strE3 = m_command.GetString(3);
    m_strE4 = m_command.GetString(4);
    m_strE5 = m_command.GetString(5);
    m_strE6 = m_command.GetString(6);
    m_strE7 = m_command.GetString(7);
    m_strE8 = m_command.GetString(8);
    m_strE9 = m_command.GetString(9);
    m_strE10 = m_command.GetString(10);
    m_strE11 = m_command.GetString(11);
    m_strE12 = m_command.GetString(12);
    m_strE13 = m_command.GetString(13);
    m_strE14 = m_command.GetString(14);
    m_strE15 = m_command.GetString(15);
    m_strE16 = m_command.GetString(16);
    m_strE17.Format(_T("%4.4f"), _tstof(m_command.GetString(17)));
    m_strE18.Format(_T("%4.4f"), _tstof(m_command.GetString(18)));
    m_strE19.Format(_T("%4.4f"), _tstof(m_command.GetString(19)));
    m_strE20.Format(_T("%4.4f"), _tstof(m_command.GetString(20)));
    m_strE21.Format(_T("%4.4f"), _tstof(m_command.GetString(21)));
    m_strE22.Format(_T("%4.4f"), _tstof(m_command.GetString(22)));
    m_strE23.Format(_T("%4.4f"), _tstof(m_command.GetString(23)));
    m_strE24.Format(_T("%4.4f"), _tstof(m_command.GetString(24)));
    m_strE25.Format(_T("%4.4f"), _tstof(m_command.GetString(25)));
    m_strE26.Format(_T("%4.4f"), _tstof(m_command.GetString(26)));
    m_strE27.Format(_T("%4.4f"), _tstof(m_command.GetString(27)));
    m_strE28.Format(_T("%4.4f"), _tstof(m_command.GetString(28)));
    m_strE29.Format(_T("%4.4f"), _tstof(m_command.GetString(29)));
    m_strE30.Format(_T("%4.4f"), _tstof(m_command.GetString(30)));
    m_strE31.Format(_T("%4.4f"), _tstof(m_command.GetString(31)));
    m_strE32.Format(_T("%4.4f"), _tstof(m_command.GetString(32)));
    m_strE33.Format(_T("%4.4f"), _tstof(m_command.GetString(33)));
    m_strE34.Format(_T("%4.4f"), _tstof(m_command.GetString(34)));
    m_strE35.Format(_T("%4.4f"), _tstof(m_command.GetString(35)));
    m_strE36.Format(_T("%4.4f"), _tstof(m_command.GetString(36)));
    m_strE37.Format(_T("%4.4f"), _tstof(m_command.GetString(37)));
    m_strE39.Format(_T("%4.4f"),_tstof(m_command.GetString(38)));
    //UpdateData(FALSE);
    //GetDlgItem(IDC_EDIT1)->SetWindowText(m_strE1);

    Updatedata(FALSE); //Invalidate();
    //  //
}

The thing is that after updating the variables, I can't update my client dialog, which means I can't use Updatedata(FALSE);
This is an image of the error:

I encountered 'Debug Assertion Failed!' and 'wincore.cpp Line : 4361'
Anyone who knows why and the solution?

A:

Pass the data to the child dialog by updating the corresponding dialog controls like so:
void CListManager::GetDataFromDb(int nMoveRecord)
{
   //....//

   m_strE1 = m_command.GetString(1);
   m_strE2 = m_command.GetString(2);

   m_pChildDlg->SetDlgItemText(IDC_E1,m_strE1);
   m_pChildDlg->SetDlgItemText(IDC_E2,m_strE2);

   m_pChildDlg->ShowWindow(true);
}

