As Raj Kapoor says you can use CenterWindow() to center the dialog box in relation to a window. Call the function in
your dialogs box OnInitDialog
BOOL CyourdlgLL OnInitDialog() {
CDialog::OnInitDialog();
//get the active frame window
CWnd* pActiveFrame= //yourGetActiveFrame
SSERT_VALID( pActiveFrame);
CenterWindow(pActiveFrame);
return true;
To center the Dialog box in the desktop window call
CenterWindow(CWnd::GetDesktopWindow());
good luck
