Changeset 28316 in vbox for trunk/src/VBox/Main/glue
- Timestamp:
- Apr 14, 2010 6:01:39 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 60075
- Location:
- trunk/src/VBox/Main/glue
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/ErrorInfo.cpp
r26603 r28316 88 88 } 89 89 90 #else // !defined (VBOX_WITH_XPCOM)91 92 nsCOMPtr 93 es = do_GetService 90 #else // defined (VBOX_WITH_XPCOM) 91 92 nsCOMPtr<nsIExceptionService> es; 93 es = do_GetService(NS_EXCEPTIONSERVICE_CONTRACTID, &rc); 94 94 if (NS_SUCCEEDED(rc)) 95 95 { 96 nsCOMPtr 97 rc = es->GetCurrentExceptionManager 96 nsCOMPtr<nsIExceptionManager> em; 97 rc = es->GetCurrentExceptionManager(getter_AddRefs (em)); 98 98 if (NS_SUCCEEDED(rc)) 99 99 { 100 100 ComPtr<nsIException> ex; 101 rc = em->GetCurrentException 101 rc = em->GetCurrentException(ex.asOutParam()); 102 102 if (NS_SUCCEEDED(rc) && ex) 103 103 { … … 114 114 bool gotSomething = false; 115 115 116 rc = ex->GetResult 116 rc = ex->GetResult(&mResultCode); 117 117 gotSomething |= NS_SUCCEEDED(rc); 118 118 119 Utf8Str message; 120 rc = ex->GetMessage(message.asOutParam()); 121 message.jolt(); 119 char *pszMsg; 120 rc = ex->GetMessage(&pszMsg); 122 121 gotSomething |= NS_SUCCEEDED(rc); 123 122 if (NS_SUCCEEDED(rc)) 124 mText = message; 123 { 124 mText = Bstr(pszMsg); 125 nsMemory::Free(mText); 126 } 125 127 126 128 if (gotSomething) … … 140 142 AssertComRC (rc); 141 143 142 #endif // !defined (VBOX_WITH_XPCOM)144 #endif // defined (VBOX_WITH_XPCOM) 143 145 } 144 146 -
trunk/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp
r26753 r28316 107 107 } 108 108 109 #if !defined 109 #if !defined(VBOX_WITH_XPCOM) 110 110 111 111 /** … … 166 166 } 167 167 168 #else // !defined 168 #else // !defined(VBOX_WITH_XPCOM) 169 169 170 170 /** … … 172 172 * object. 173 173 */ 174 HRESULT VirtualBoxErrorInfo::init 174 HRESULT VirtualBoxErrorInfo::init(nsIException *aInfo) 175 175 { 176 176 AssertReturn(aInfo, E_FAIL); … … 182 182 * corresponding fields will simply remain null in this case). */ 183 183 184 rc = aInfo->GetResult (&mResultCode); 185 AssertComRC (rc); 186 Utf8Str message; 187 rc = aInfo->GetMessage(message.asOutParam()); 188 message.jolt(); 189 AssertComRC (rc); 190 mText = message; 184 rc = aInfo->GetResult(&mResultCode); 185 AssertComRC(rc); 186 187 char *pszMsg; 188 rc = aInfo->GetMessage(&pszMsg); 189 AssertComRC(rc); 190 if (NS_SUCCEEDED(rc)) 191 { 192 mText = Bstr(pszMsg); 193 nsMemory::Free(pszMsg); 194 } 195 else 196 mText.setNull(); 191 197 192 198 return S_OK; … … 273 279 nsIException, IVirtualBoxErrorInfo) 274 280 275 #endif /* !defined 281 #endif /* !defined(VBOX_WITH_XPCOM) */ 276 282 277 283 ////////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.