[commit] r1499 - trunk/SDK/BON/Common
GMESRC Repository Notifications
gme-commit at list.isis.vanderbilt.edu
Thu Sep 1 10:53:38 CDT 2011
Author: ksmyth
Date: Thu Sep 1 10:53:38 2011
New Revision: 1499
Log:
Refactor
Modified:
trunk/SDK/BON/Common/Exceptions.h
Modified: trunk/SDK/BON/Common/Exceptions.h
==============================================================================
--- trunk/SDK/BON/Common/Exceptions.h Thu Sep 1 10:52:07 2011 (r1498)
+++ trunk/SDK/BON/Common/Exceptions.h Thu Sep 1 10:53:38 2011 (r1499)
@@ -28,6 +28,7 @@
#include <StdAfx.h>
#include <string>
#include <vector>
+#include <comdef.h>
template<class T>
@@ -40,15 +41,11 @@
CComQIPtr<IErrorInfo> errorInfo;
GetErrorInfo(0, &errorInfo);
- BSTR bstr;
- errorInfo->GetDescription(&bstr);
- CStringA str( bstr );
- std::string strResult( str.GetBuffer( str.GetLength() ) );
- str.ReleaseBuffer();
- SysFreeString(bstr);
+ _bstr_t bstr;
+ errorInfo->GetDescription(bstr.GetAddress());
BON::Exception exception(hr, "?");
- exception << strResult;
+ exception << static_cast<const TCHAR*>(bstr);
throw exception;
} else {
BON::Exception exception(hr);
More information about the gme-commit
mailing list