[commit] r2028 - trunk/GME/Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Aug 21 13:11:28 CDT 2012


Author: ksmyth
Date: Tue Aug 21 13:11:28 2012
New Revision: 2028

Log:
ModelOpen and ModelClose events: GetErrorInfo (follow up to If addon fails in CommitTransaction, SetErrorInfo to include Addon progid)

Modified:
   trunk/GME/Gme/GMEView.cpp

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Thu Aug 16 12:31:38 2012	(r2027)
+++ trunk/GME/Gme/GMEView.cpp	Tue Aug 21 13:11:28 2012	(r2028)
@@ -1526,12 +1526,24 @@
 
 		COMTHROW(currentModel->SendEvent(OBJEVENT_OPENMODEL));
 
-		CommitTransaction();
+		__CommitTransaction();
 	}
 	catch(hresult_exception &e) {
 		AbortTransaction(e.hr);
 		ok = false;
 	}
+	catch(_com_error& e) {
+		AbortTransaction(e.Error());
+		ok = false;
+		CString error = _T("Notifying Addons of OpenModel failed");
+		if (e.Description().length() != 0)
+		{
+			error += _T(": ");
+			error += static_cast<const TCHAR*>(e.Description());
+		}
+		CGMEEventLogger::LogGMEEvent(error + _T("\r\n"));
+		AfxMessageBox(error,MB_ICONSTOP | MB_OK);
+	}
 	return ok;
 }
 
@@ -1552,6 +1564,18 @@
 		} // Our transaction count was wrong. What else can we do?
 		ok = false;
 	}
+	catch(_com_error& e) {
+		AbortTransaction(e.Error());
+		ok = false;
+		CString error = _T("Notifying Addons of CloseModel failed");
+		if (e.Description().length() != 0)
+		{
+			error += _T(": ");
+			error += static_cast<const TCHAR*>(e.Description());
+		}
+		CGMEEventLogger::LogGMEEvent(error + _T("\r\n"));
+		AfxMessageBox(error,MB_ICONSTOP | MB_OK);
+	}
 	return ok;
 }
 


More information about the gme-commit mailing list