[commit] r2612 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Oct 7 06:55:49 CDT 2015


Author: ksmyth
Date: Wed Oct  7 06:55:49 2015
New Revision: 2612

Log:
Better error message

Modified:
   trunk/GME/Gme/GMEApp.cpp

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Wed Oct  7 06:55:40 2015	(r2611)
+++ trunk/GME/Gme/GMEApp.cpp	Wed Oct  7 06:55:49 2015	(r2612)
@@ -2052,9 +2052,23 @@
 	if(mgaProject != NULL && (proj_type_is_mga||proj_type_is_xmlbackend)) {
 		HRESULT hr = mgaProject->Save(NULL, VARIANT_FALSE);
 		if(hr != S_OK) {
-			AfxMessageBox(_T("ERROR: Could not save project\nCheck access permissions"));
-			return false;
-		}
+			CComBSTR error;
+			if (GetErrorInfo(&error)) {
+                CString errmsg = _T("Could not save project: ");
+
+                errmsg += error;
+                if (hr == HRESULT_FROM_WIN32(ERROR_ACCESS_DENIED)) {
+				    // FIXME: KMS: not too sure why this is ACCESS_DENIED from MoveFile instead of SHARING_VIOLATION
+                    errmsg += _T("\nCheck that no other GME has this file open");
+                }
+                AfxMessageBox(errmsg);
+                return false;
+            }
+            else {
+                AfxMessageBox(_T("ERROR: Could not save project\nCheck access permissions"));
+                return false;
+            }
+        }
 		abort_on_close = true;
 	}
 


More information about the gme-commit mailing list