[commit] r1488 - in trunk/GME: Common Gme

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Aug 31 20:33:18 CDT 2011


Author: ksmyth
Date: Wed Aug 31 20:33:17 2011
New Revision: 1488

Log:
GetErrorInfo after RunComponent

Modified:
   trunk/GME/Common/CommonMfc.h
   trunk/GME/Gme/GMEApp.cpp
   trunk/GME/Gme/GMEView.cpp
   trunk/GME/Gme/StdAfx.cpp

Modified: trunk/GME/Common/CommonMfc.h
==============================================================================
--- trunk/GME/Common/CommonMfc.h	Wed Aug 31 20:01:28 2011	(r1487)
+++ trunk/GME/Common/CommonMfc.h	Wed Aug 31 20:33:17 2011	(r1488)
@@ -7,6 +7,7 @@
 #endif
 
 #include "afxtempl.h"
+#include "comdef.h"
 
 // --------------------------- CString
 
@@ -268,6 +269,15 @@
 	{ \
 		{ CLEANUP; } \
 		DisplayError(MSG, e.hr); \
+	} \
+	catch(_com_error &e) { \
+		{ CLEANUP; } \
+		_bstr_t error; \
+		if (e.Description() != _bstr_t()) \
+			error = e.Description(); \
+		else \
+			GetErrorInfo(e.Error(), error.GetAddress()); \
+		AfxMessageBox(_bstr_t(MSG) + ": " + error, MB_OK | MB_ICONSTOP); \
 	}
 
 #endif//MGA_COMMONMFC_H

Modified: trunk/GME/Gme/GMEApp.cpp
==============================================================================
--- trunk/GME/Gme/GMEApp.cpp	Wed Aug 31 20:01:28 2011	(r1487)
+++ trunk/GME/Gme/GMEApp.cpp	Wed Aug 31 20:33:17 2011	(r1488)
@@ -2641,8 +2641,8 @@
 void CGMEApp::RunComponent(const CString &compname)
 {
 
-	CComPtr<IMgaLauncher> launcher;
-	launcher.CoCreateInstance(CComBSTR(L"Mga.MgaLauncher") );
+	IMgaLauncherPtr launcher;
+	launcher.CreateInstance(L"Mga.MgaLauncher");
 	if(!launcher) {
 		AfxMessageBox(_T("Cannot start up component launcher"));
 	}

Modified: trunk/GME/Gme/GMEView.cpp
==============================================================================
--- trunk/GME/Gme/GMEView.cpp	Wed Aug 31 20:01:28 2011	(r1487)
+++ trunk/GME/Gme/GMEView.cpp	Wed Aug 31 20:33:17 2011	(r1488)
@@ -7134,8 +7134,8 @@
 	GMEEVENTLOG_GUIFCOS(selected);
 	MSGTRY
 	{
-		CComObjPtr<IMgaLauncher> launcher;
-		COMTHROW( launcher.CoCreateInstance(L"Mga.MgaLauncher") );
+		IMgaLauncherPtr launcher;
+		COMTHROW( launcher.CreateInstance(L"Mga.MgaLauncher") );
 		if(!launcher) {
 			AfxMessageBox(_T("Cannot start up component launcher"));
 			CGMEEventLogger::LogGMEEvent(_T("    Cannot start up component launcher.\r\n"));
@@ -7152,10 +7152,7 @@
 			}
 
 			if(theApp.bNoProtect) COMTHROW( launcher->put_Parameter(CComVariant(true)));
-			if(launcher->RunComponent(NULL, theApp.mgaProject, focus, selfcos, GME_MAIN_START) != S_OK) {
-				AfxMessageBox(_T("Component execution failed"));
-				CGMEEventLogger::LogGMEEvent(_T("    Component execution failed.\r\n"));
-			}
+			launcher->__RunComponent(_bstr_t(), theApp.mgaProject, focus, selfcos, GME_MAIN_START);
 		}
 	}
 	MSGCATCH(_T("Error while trying to run the interpreter"),;)

Modified: trunk/GME/Gme/StdAfx.cpp
==============================================================================
--- trunk/GME/Gme/StdAfx.cpp	Wed Aug 31 20:01:28 2011	(r1487)
+++ trunk/GME/Gme/StdAfx.cpp	Wed Aug 31 20:33:17 2011	(r1488)
@@ -4,5 +4,6 @@
 
 #include "stdafx.h"
 
+#import "MgaUtilLib.tlb" implementation_only auto_search no_namespace no_search_namespace raw_method_prefix("") high_method_prefix("__")
 
 


More information about the gme-commit mailing list