You can do that easily. The 2nd dialog is opened by calling
DoModal()[
^] but before calling this function you can assign values to any public member variables in the 2nd Dialog class.
Let's assume the 2nd Dialog has "firstmarameter" and "another parameter" as member variables. We can assume the first Dialog also has a member variable named 'data', so you can see how to assign values from one dialog to another:
void CPrimary1Dlg::OnBnClickedSecondBtn()
{
CSecondDlg Dlg;
Dlg.firstparameter = data;
Dlg.anotherparameter = "This is my new dialog";
Dlg.DoModal();
}