You can simply do it through the CWinApp that runs the show... He has the pointers to everyone, so you can just pass the handle to either dialog as part of the initialization.
Somewhere in CWinApp():
CDialog1 dialog1;
CDialog2 dialog2;
dialog1.mp_other_dialog = &dialog2;
dialog2.mp_other_dialog = &dialog1;
where:
CDialog1
and
CDialog2
are derived from
CDialog
.
and:
CDialog* mp_other_dialog;
Alternatively, you can also make a method in whatever parent class (again, CWinApp could be used) that will return a requested pointer. For example:
CWinApp *theApp;
CDialog* dialog = theApp->GetDialog(TYPE);