[commit] r1123 - trunk/GME/MgaUtil

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Jan 11 11:16:05 CST 2011


Author: ksmyth
Date: Tue Jan 11 11:16:04 2011
New Revision: 1123

Log:
Dont ASSERT that a progid has a dll: it may have been removed from the COM registry

Modified:
   trunk/GME/MgaUtil/CompDlg.cpp

Modified: trunk/GME/MgaUtil/CompDlg.cpp
==============================================================================
--- trunk/GME/MgaUtil/CompDlg.cpp	Mon Jan 10 16:20:36 2011	(r1122)
+++ trunk/GME/MgaUtil/CompDlg.cpp	Tue Jan 11 11:16:04 2011	(r1123)
@@ -194,8 +194,8 @@
 			else is_ass = can_ass = VARIANT_TRUE;
 
 			HRESULT hr = registrar->GetLocalDllPathDisp(progids[i], PutOut(localDllDispPath));
-			ASSERT(SUCCEEDED(hr));
-			localDllDispPathStr = (const char*)PutInCString(localDllDispPath);
+                        if (SUCCEEDED(hr))
+                                localDllDispPathStr = (const char*)PutInCString(localDllDispPath);
 /*#define BUFSIZE 1024
 			TCHAR buffer[BUFSIZE]=TEXT("");
 			DWORD retval = GetFullPathName(localDllDispPathStr, BUFSIZE, buffer, NULL);
@@ -420,7 +420,7 @@
 
 	if(!registrar) {
 		std::string errorMessage = "Unable to create component registrar: ";
-		errorMessage += static_cast<const char*>(_com_error(hr).ErrorMessage());
+		errorMessage += _com_error(hr).ErrorMessage();
 		::AfxMessageBox(errorMessage.c_str());
 	} else {
 		hr = registrar->RegisterComponentLibrary(PutInBstr(path), regacc_translate(m_accessmode));
@@ -434,7 +434,7 @@
 				COMTHROW(info->GetDescription(&description));
 				errorMessage += static_cast<const char*>(_bstr_t(description));
 			} else {
-				errorMessage += static_cast<const char*>(_com_error(hr).ErrorMessage());
+				errorMessage += _com_error(hr).ErrorMessage();
 			}
 			AfxMessageBox(errorMessage.c_str(), MB_ICONSTOP | MB_OK);
 		}


More information about the gme-commit mailing list