[commit] r2043 - in trunk/GME: Gme Interfaces MgaUtil Parser

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Sep 5 16:31:33 CDT 2012


Author: ksmyth
Date: Wed Sep  5 16:31:32 2012
New Revision: 2043

Log:
Add property to get/set resolver for MgaParser

Modified:
   trunk/GME/Gme/StdAfx.h
   trunk/GME/Interfaces/Parser.idl
   trunk/GME/MgaUtil/MgaResolver.cpp
   trunk/GME/MgaUtil/StdAfx.h
   trunk/GME/Parser/MetaParser.cpp
   trunk/GME/Parser/MgaParser.cpp
   trunk/GME/Parser/MgaParser.h
   trunk/GME/Parser/MgaParserBC.cpp
   trunk/GME/Parser/MgaParserSC.cpp
   trunk/GME/Parser/ParserLib.idl
   trunk/GME/Parser/StdAfx.h

Modified: trunk/GME/Gme/StdAfx.h
==============================================================================
--- trunk/GME/Gme/StdAfx.h	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Gme/StdAfx.h	Wed Sep  5 16:31:32 2012	(r2043)
@@ -53,9 +53,9 @@
 #import "CoreLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "MetaLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "MgaLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
+#import "MgaUtilLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "ParserLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "GMELib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
-#import "MgaUtilLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 
 #include "CommonImport.h"
 

Modified: trunk/GME/Interfaces/Parser.idl
==============================================================================
--- trunk/GME/Interfaces/Parser.idl	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Interfaces/Parser.idl	Wed Sep  5 16:31:32 2012	(r2043)
@@ -4,6 +4,7 @@
 #include "InterfaceVersion.h"
 
 import "Mga.idl";
+import "MgaUtil.idl";
 
 // --------------------------- Parser IDL
 
@@ -108,3 +109,18 @@
 	HRESULT ParseFCOs2([in] IMgaObject *here, [in] BSTR xmlfile, ULONGLONG hwndParent);
 	HRESULT GetXMLParadigm([in] BSTR xmlfile, [out] BSTR *Paradigm);
 };
+
+[
+	object,
+	uuid("5CAB528B-474B-4C52-BE40-74FF29AFBB58"),
+	dual,
+	helpstring("IMgaParser3 Interface"),
+	pointer_default(unique)
+]
+interface IMgaParser3 : IMgaParser2
+{
+	[propget]
+	HRESULT Resolver([out, retval] IMgaResolver** MgaResolver);
+	[propput]
+	HRESULT Resolver([in] IMgaResolver* MgaResolver);
+};

Modified: trunk/GME/MgaUtil/MgaResolver.cpp
==============================================================================
--- trunk/GME/MgaUtil/MgaResolver.cpp	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/MgaUtil/MgaResolver.cpp	Wed Sep  5 16:31:32 2012	(r2043)
@@ -592,6 +592,8 @@
 				}
 
 			}
+			if (!this->mb_is_interactive)
+				return RESOLV_ERR_get_KindByStr;
 			// update mapping
 			this->map_put_KindByStr(parent_mf.p, kind, objtype, *p);
 
@@ -896,6 +898,9 @@
 
 						return S_OK;
 					}
+					if (!this->mb_is_interactive) {
+						return RESOLV_ERR_get_RoleByStr;
+					}
 
 					// else, check each possible aspect
 

Modified: trunk/GME/MgaUtil/StdAfx.h
==============================================================================
--- trunk/GME/MgaUtil/StdAfx.h	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/MgaUtil/StdAfx.h	Wed Sep  5 16:31:32 2012	(r2043)
@@ -60,9 +60,9 @@
 #import "CoreLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "MetaLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "MgaLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
+#import "MgaUtilLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "ParserLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 #import "GMELib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
-#import "MgaUtilLib.tlb" no_implementation no_namespace raw_method_prefix("") high_method_prefix("__") no_registry
 
 #include "CommonImport.h"
 

Modified: trunk/GME/Parser/MetaParser.cpp
==============================================================================
--- trunk/GME/Parser/MetaParser.cpp	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/MetaParser.cpp	Wed Sep  5 16:31:32 2012	(r2043)
@@ -23,8 +23,6 @@
 {
 	try
 	{
-		CloseAll();
-
 		ASSERT( metaproject == NULL );
 		COMTHROW( metaproject.CoCreateInstance(L"Mga.MgaMetaProject") );
 

Modified: trunk/GME/Parser/MgaParser.cpp
==============================================================================
--- trunk/GME/Parser/MgaParser.cpp	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/MgaParser.cpp	Wed Sep  5 16:31:32 2012	(r2043)
@@ -25,8 +25,6 @@
 
 	try
 	{
-		CloseAll();
-
 		HWND hwndParent = (HWND)hwndParent_;
 		if (hwndParent != 0)
 		{
@@ -55,8 +53,11 @@
 		project_prefs = project_prefs_orig | MGAPREF_IGNORECONNCHECKS;
 		COMTHROW( p->put_Preferences(project_prefs) );
 
-		COMTHROW( resolver.CoCreateInstance(L"Mga.MgaResolver") );
-		ASSERT( resolver != NULL );
+		if (resolver == NULL)
+		{
+			COMTHROW( resolver.CoCreateInstance(L"Mga.MgaResolver") );
+			ASSERT( resolver != NULL );
+		}
 
 		project = p;
 
@@ -169,8 +170,6 @@
 
 	try
 	{
-		CloseAll();
-
 		HWND hwndParent = (HWND)hwndParent_;
 		if (hwndParent != 0)
 		{
@@ -206,8 +205,11 @@
 		project_prefs = project_prefs_orig | MGAPREF_IGNORECONNCHECKS;
 		COMTHROW( project->put_Preferences(project_prefs) );
 
-		COMTHROW( resolver.CoCreateInstance(L"Mga.MgaResolver") );
-		ASSERT( resolver != NULL );
+		if (resolver == NULL)
+		{
+			COMTHROW( resolver.CoCreateInstance(L"Mga.MgaResolver") );
+			ASSERT( resolver != NULL );
+		}
 
 		CopyTo(filename, xmlfile);
 
@@ -333,8 +335,6 @@
 
 	try
 	{
-		CloseAll();
-
 		CopyTo(filename, xmlfile);
 
 		XMLPlatformUtilsTerminate_RAII term;
@@ -1772,8 +1772,6 @@
 {
 	try
 	{
-		CloseAll();
-
 		CopyTo(filename, xmlfile);
 
 		XMLPlatformUtilsTerminate_RAII term;

Modified: trunk/GME/Parser/MgaParser.h
==============================================================================
--- trunk/GME/Parser/MgaParser.h	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/MgaParser.h	Wed Sep  5 16:31:32 2012	(r2043)
@@ -31,8 +31,8 @@
 class ATL_NO_VTABLE CMgaParser : 
 	public CComObjectRootEx<CComSingleThreadModel>,
 	public CComCoClass<CMgaParser, &CLSID_MgaParser>,
-	public ISupportErrorInfoImpl2<&IID_IMgaParser, &IID_IMgaParser2>,
-	public IDispatchImpl<IMgaParser2, &IID_IMgaParser2, &LIBID_MGAParserLib, 1, 1>,
+	public ISupportErrorInfoImpl3<&IID_IMgaParser, &IID_IMgaParser2, &IID_IMgaParser3>,
+	public IDispatchImpl<IMgaParser3, &IID_IMgaParser3, &LIBID_MGAParserLib, 1, 1>,
 	public IGMEVersionInfoImpl,
 	public CGenParser
 {
@@ -47,9 +47,10 @@
 DECLARE_PROTECT_FINAL_CONSTRUCT()
 
 BEGIN_COM_MAP(CMgaParser)
-	COM_INTERFACE_ENTRY2(IMgaParser, IMgaParser2)
-	COM_INTERFACE_ENTRY2(IDispatch, IMgaParser2)
+	COM_INTERFACE_ENTRY2(IMgaParser, IMgaParser3)
+	COM_INTERFACE_ENTRY2(IDispatch, IMgaParser3)
 	COM_INTERFACE_ENTRY(IMgaParser2)
+	COM_INTERFACE_ENTRY2(IMgaParser3, IMgaParser3)
 	COM_INTERFACE_ENTRY(ISupportErrorInfo)
 	COM_INTERFACE_ENTRY_IID(IID_IGMEVersionInfo, IGMEVersionInfoImpl)
 END_COM_MAP()
@@ -273,6 +274,24 @@
 
 	void StartClipboardInfo(const attributes_type &attributes);
 
+	STDMETHOD(get_Resolver)(IMgaResolver **MgaResolver) {
+		if (this->resolver)
+		{
+			resolver->AddRef();
+		}
+		*MgaResolver = this->resolver;
+		return S_OK;
+	}
+    STDMETHOD(put_Resolver)(IMgaResolver *MgaResolver)
+	{
+		if (this->resolver)
+		{
+			this->resolver.Release();
+		}
+		this->resolver = MgaResolver;
+		return S_OK;
+	}
+
 	protected:
 		static CComPtr<IGMEOLEApp>	get_GME(CComObjPtr<IMgaProject> project);
 		static void					clear_GME( CComPtr<IGMEOLEApp>& p_GME);

Modified: trunk/GME/Parser/MgaParserBC.cpp
==============================================================================
--- trunk/GME/Parser/MgaParserBC.cpp	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/MgaParserBC.cpp	Wed Sep  5 16:31:32 2012	(r2043)
@@ -18,8 +18,6 @@
 
 	try
 	{
-		CloseAll();
-
 		COMTHROW( progress.CoCreateInstance(L"Mga.MgaProgressDlg") );
 		COMTHROW( progress->SetTitle(_bstr_t(L"Importing CopyClosured XML data...")) );
 		COMTHROW( progress->StartProgressDialog(NULL) );

Modified: trunk/GME/Parser/MgaParserSC.cpp
==============================================================================
--- trunk/GME/Parser/MgaParserSC.cpp	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/MgaParserSC.cpp	Wed Sep  5 16:31:32 2012	(r2043)
@@ -20,8 +20,6 @@
 
 	try
 	{
-		CloseAll();
-
 		COMTHROW( progress.CoCreateInstance(L"Mga.MgaProgressDlg") );
 		COMTHROW( progress->SetTitle(_bstr_t(L"Importing SmartCopied XML data...")) );
 		COMTHROW( progress->StartProgressDialog(NULL) );

Modified: trunk/GME/Parser/ParserLib.idl
==============================================================================
--- trunk/GME/Parser/ParserLib.idl	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/ParserLib.idl	Wed Sep  5 16:31:32 2012	(r2043)
@@ -4,7 +4,7 @@
 
 import "Parser.idl";
 import "Core.idl";
-
+import "MgaUtil.idl";
 
 // --------------------------- Parser Library
 
@@ -21,6 +21,7 @@
 	importlib("CoreLib.tlb");
 	importlib("MetaLib.tlb");
 	importlib("MgaLib.tlb");
+	importlib("MgaUtilLib.tlb");
 
 	enum inserttype_enum;
 
@@ -52,7 +53,8 @@
 	]
 	coclass MgaParser
 	{
-		[default] interface IMgaParser2;
+		[default] interface IMgaParser3;
+		interface IMgaParser2;
 		interface IMgaParser;
 		interface IGMEVersionInfo;
 	};

Modified: trunk/GME/Parser/StdAfx.h
==============================================================================
--- trunk/GME/Parser/StdAfx.h	Wed Sep  5 16:31:12 2012	(r2042)
+++ trunk/GME/Parser/StdAfx.h	Wed Sep  5 16:31:32 2012	(r2043)
@@ -84,6 +84,17 @@
 	}
 };
 
+template <const IID* piid1, const IID* piid2, const IID* piid3>
+class ATL_NO_VTABLE ISupportErrorInfoImpl3 : 
+	public ISupportErrorInfo
+{
+public:
+	STDMETHOD(InterfaceSupportsErrorInfo)(_In_ REFIID riid)
+	{
+		return (InlineIsEqualGUID(riid,*piid1) || InlineIsEqualGUID(riid,*piid2) || InlineIsEqualGUID(riid,*piid3)) ? S_OK : S_FALSE;
+	}
+};
+
 
 //{{AFX_INSERT_LOCATION}}
 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.


More information about the gme-commit mailing list