[GME-commit] GMESRC/GME/GMEActiveBrowser ActiveBrowserPropertyPage.cpp,1.49,1.50 MgaContext.h,1.3,1.4

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Thu Jun 8 23:22:51 CDT 2006


Update of /project/gme-repository/GMESRC/GME/GMEActiveBrowser
In directory escher:/tmp/cvs-serv17168

Modified Files:
	ActiveBrowserPropertyPage.cpp MgaContext.h 
Log Message:
Sppeding up the Attach operation by toggling ConstrManager.


CVS User: Zoltan Molnar, ISIS (zolmol)

Index: MgaContext.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/MgaContext.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** MgaContext.h	18 Nov 2002 20:09:00 -0000	1.3
--- MgaContext.h	8 Jun 2006 22:22:48 -0000	1.4
***************
*** 40,42 ****
--- 40,72 ----
  };
  
+ class Utils
+ {
+ public:
+ 	static CComPtr<IGMEOLEApp> get_GME( CComPtr<IMgaProject> p_mgaproject)
+ 	{
+ 		CComPtr<IGMEOLEApp> gme;
+ 		if( p_mgaproject) {		
+ 			CComBSTR bstrName("GME.Application");
+ 			CComPtr<IMgaClient> pClient;
+ 			HRESULT hr = p_mgaproject->GetClientByName(bstrName, &pClient);
+ 			if (SUCCEEDED(hr) && pClient) {
+ 				CComPtr<IDispatch> pDispatch;
+ 				hr = pClient->get_OLEServer(&pDispatch);
+ 				if (SUCCEEDED(hr) && pDispatch) {
+ 					hr = pDispatch.QueryInterface(&gme);
+ 					if (FAILED(hr)) {
+ 						gme = NULL;
+ 					}
+ 				}
+ 			}
+ 		}
+ 		return gme;
+ 	} 
+ 
+ 	static void put2Console( CComPtr<IGMEOLEApp> gme, CComBSTR msg, msgtype_enum typ)
+ 	{
+ 		if(gme) gme->ConsoleMessage( msg, typ);
+ 	}
+ };
+ 
  #endif // !defined(AFX_MGACONTEXT_H__48B8CD86_FF78_4183_8360_D33CE1792CD7__INCLUDED_)

Index: ActiveBrowserPropertyPage.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/GMEActiveBrowser/ActiveBrowserPropertyPage.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** ActiveBrowserPropertyPage.cpp	2 May 2006 22:06:41 -0000	1.49
--- ActiveBrowserPropertyPage.cpp	8 Jun 2006 22:22:48 -0000	1.50
***************
*** 1498,1501 ****
--- 1498,1504 ----
  					CGMEActiveBrowserApp* pApp=(CGMEActiveBrowserApp*)AfxGetApp();
  					CMgaContext* pMgaContext=&pApp->m_CurrentProject.m_MgaContext;
+ 					
+ 					// toggle off Constraint Manager
+ 					if( pMgaContext && pMgaContext->m_ccpConstMgr) COMTHROW( pMgaContext->m_ccpConstMgr->Enable( false));
  
  					pMgaContext->BeginTransaction(FALSE);
***************
*** 1504,1507 ****
--- 1507,1516 ----
  					pMgaContext->CommitTransaction();
  					
+ 					// toggle back Constraint Manager (done only after commit, so that it will not catch the events happened in the transaction)
+ 					if( pMgaContext && pMgaContext->m_ccpConstMgr) COMTHROW( pMgaContext->m_ccpConstMgr->Enable( true));
+ 
+ 					Utils::put2Console( Utils::get_GME( pMgaContext->m_ccpProject)
+ 						, CComBSTR("Library attached. (Note: Constraint Manager was turned off during attach to speed it up.)")
+ 						, MSG_INFO);
  				}
  			}



More information about the GME-commit mailing list