SF 3435567

Possibility to pass a NULL Dispatch pointer
Fix a memory leak (detected with Glowcode) in Variant.cpp/zeroVariant function
Variant.toString improvement to handle NULL cases
Adds the error code to the message when "an unknown COM error has occurred"
Added debug info to EventProxy advise registration failure message.
This commit is contained in:
clay_shooter
2011-12-11 16:57:28 +00:00
parent e5652e3b75
commit 1e69bb9acb
6 changed files with 61 additions and 5 deletions

View File

@@ -342,8 +342,15 @@ static wchar_t* CreateErrorMsgFromResult(HRESULT inResult)
msg = (wchar_t*) ::LocalAlloc(LPTR, bufferLength);
wcscpy_s(msg, bufferLength, message_text);
}
// SF 3435567 add HRESULT to error message
size_t bufferLength = (wcslen(msg) + 100) * sizeof(wchar_t);
wchar_t* plus = (wchar_t*) ::LocalAlloc(LPTR, bufferLength);
// Had to force this to wide/unicode. We must be missing a macro or setting somewhere
wsprintfW(plus, L"%x / %s", inResult, msg);
return msg;
::LocalFree(msg);
return plus;
}
static wchar_t* CreateErrorMsgFromInfo(HRESULT inResult, EXCEPINFO* ioInfo,