summaryrefslogtreecommitdiffstats
path: root/Source/MFCDialog/CMakeSetupDialog.cpp
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-10-29 15:41:31 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-10-29 15:41:31 (GMT)
commitb0e3a2def0c20f20e4cbcf0ff03017777dc1a896 (patch)
treef9a49e971fc787ba7ba5e02ba950046ab4390731 /Source/MFCDialog/CMakeSetupDialog.cpp
parent539318f5875de0c0d0e008f820a3bd721d322f09 (diff)
downloadCMake-b0e3a2def0c20f20e4cbcf0ff03017777dc1a896.zip
CMake-b0e3a2def0c20f20e4cbcf0ff03017777dc1a896.tar.gz
CMake-b0e3a2def0c20f20e4cbcf0ff03017777dc1a896.tar.bz2
ENH: use callback not ifdef for MFC message box errors
Diffstat (limited to 'Source/MFCDialog/CMakeSetupDialog.cpp')
-rw-r--r--Source/MFCDialog/CMakeSetupDialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/MFCDialog/CMakeSetupDialog.cpp b/Source/MFCDialog/CMakeSetupDialog.cpp
index 3f1fb8f..11da2ca 100644
--- a/Source/MFCDialog/CMakeSetupDialog.cpp
+++ b/Source/MFCDialog/CMakeSetupDialog.cpp
@@ -61,6 +61,17 @@ BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP();
+void MFCMessageCallback(const char* m, const char* title, bool& nomore)
+{
+ std::string message = m;
+ message += "\n\n(Press Cancel to suppress any further messages.)";
+ if(::MessageBox(0, message.c_str(), title,
+ MB_OKCANCEL) == IDCANCEL)
+ {
+ nomore = true;
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////
// CMakeSetupDialog dialog
@@ -68,6 +79,7 @@ CMakeSetupDialog::CMakeSetupDialog(const CMakeCommandLineInfo& cmdInfo,
CWnd* pParent /*=NULL*/)
: CDialog(CMakeSetupDialog::IDD, pParent)
{
+ cmSystemTools::SetErrorCallback(MFCMessageCallback);
m_RegistryKey = "Software\\Kitware\\CMakeSetup\\Settings\\StartPath";
//{{AFX_DATA_INIT(CMakeSetupDialog)