[commit] r2538 - trunk/SDK/BON/Common

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Wed Sep 24 10:27:34 CDT 2014


Author: ksmyth
Date: Wed Sep 24 10:27:34 2014
New Revision: 2538

Log:
Fix for BON/BON2: towards supporting compilation without MFC/ATL

Modified:
   trunk/SDK/BON/Common/BONImpl.cpp
   trunk/SDK/BON/Common/Exceptions.h

Modified: trunk/SDK/BON/Common/BONImpl.cpp
==============================================================================
--- trunk/SDK/BON/Common/BONImpl.cpp	Wed Sep 24 09:55:11 2014	(r2537)
+++ trunk/SDK/BON/Common/BONImpl.cpp	Wed Sep 24 10:27:34 2014	(r2538)
@@ -958,7 +958,7 @@
 			if( FAILED( hr)) 
 				ASSERTTHROW( Exception( "Can't retrieve GME Application object" ) );
 			if (pClient) {
-				CComQIPtr<IDispatch> pDispatch;
+				CComPtr<IDispatch> pDispatch;
 				COMCHECK2(pClient, pClient->get_OLEServer(&pDispatch));
 				if (pDispatch) {
 					BONCOMTHROW(pDispatch.QueryInterface(m_gme.Addr()));

Modified: trunk/SDK/BON/Common/Exceptions.h
==============================================================================
--- trunk/SDK/BON/Common/Exceptions.h	Wed Sep 24 09:55:11 2014	(r2537)
+++ trunk/SDK/BON/Common/Exceptions.h	Wed Sep 24 10:27:34 2014	(r2538)
@@ -37,9 +37,9 @@
 	if (!SUCCEEDED(hr)) {
 		const IID piid = __uuidof(T);
 		ISupportErrorInfo* supportErrorInfo;
-		p->QueryInterface(__uuidof(ISupportErrorInfo), &supportErrorInfo);
+		p->QueryInterface(__uuidof(ISupportErrorInfo), (void**)&supportErrorInfo);
 		if (supportErrorInfo != NULL && supportErrorInfo->InterfaceSupportsErrorInfo(piid) == S_OK) {
-			p->Release();
+			supportErrorInfo->Release();
 			IErrorInfo* errorInfo;
 			GetErrorInfo(0, &errorInfo);
 
@@ -54,12 +54,23 @@
 			exception << static_cast<const TCHAR*>(bstr);
 			throw exception;
 		} else {
+			if (supportErrorInfo != NULL) {
+				supportErrorInfo->Release();
+			}
 			BON::Exception exception(hr);
 			throw exception;
-		}
+        }
 	}
 }
 
+#ifdef __AFX_H__
+template<class T>
+inline void COMCHECK2(const CComPtr<T>& p, const HRESULT hr)
+{
+	COMCHECK2(p.p, hr);
+}
+#endif
+
 #define ASSERTTHROW( exc )									\
 	{																\
 		ASSERT( ( exc.getErrorMessage().c_str(), false ) );		\


More information about the gme-commit mailing list