windowsvisual-c++mfcvisual-c++-2008

Is there a conventional/standard way to create an MFC error dialog?


I'd like to create a dialog for my application that shows a message and displays the standard red circle with the white "x" in the middle; seems to me this is a pretty standard windows dialog. I'm somewhat new to MFC, so I don't know if there's a short-cut to do this other than creating a dialog resource, copying the image of the red x from microsoft's best practices page, including that as a dialog item and then coding up my own. Surely there is a more standard way to do this?


Solution

  • AfxMessageBox(_T("Something bad happened!"), MB_OK | MB_ICONSTOP);
    

    See also AfxMessageBox.