Hey first thing That if you called message box on OnOk()
then
void YourDialog::OnOk()
{
AfxMessageBox("HELLO");
OnOk();
}
Then it display message and Di8alog will invisible,
So
For Remain in Same dialog after displaying messagebox please remove OnOk();
void YourDialog::OnOk()
{
AfxMessageBox("HELLO");
}
Now if you want to Hide the dialog then just Called OnCancel() or OnOk();
If Not understand then please provide your code block where you doing all this activities.