When i try to put a messagebox in the OnInitDialog Handler using VS2005 the dialogs modal property is removed.
BOOL CDlg::OnInitDialog()
{
CDialog::OnInitDialog();
AfxMessageBox("hi"); //This message box removes the dialog's modal property and it default properties.
return TRUE;
}
CMyView::OnShowDialog()
{
CDlg dlg;
dlg.DoModal();
}
Is this a bug or am i wrong somewhere

Displaying MessageBox in OnInitDialog handler
Gloria123
2. The default location of the dialog was set to centerparent but after displaying the messagebox dialog's location is defaulted to windows default location
Priya RV
I dont think you are wrong here. Its the internal implementation of MFC.
You can use MessageBox instead of AfxMessageBox. This should not cause any problem.
Regards
Kevin Service
what all are missing and how it's behaving