Vladimir.
"robin" <robi...@21cn.com> wrote in message
news:OIC7pKMVAHA.216@cppssbbsa03...
> In a COM environment program , I need to handle COM exception, use the
> function: void _com_issue_error(HRESULT)
> //...
> HRESULT hr;
> _com_issue_error(hr);
> //...
> VC even display parameter of the function, but i built it, VC prompt
> " _com_issue_error " is undeclare identifier !
> and i can't found the Document about "_com_issue_error" in MSDN, why ?
>
>
>
>
>
>
What's the reason for the "unless it's ATL" bit? I thought you just plain
shouldn't throw exceptions across a COM interface ?
Paul
Actually, it's just rude to throw exceptions that you don't plan on
catching. If you want to throw an exception to catch it in another part of
your code, that's perfectly fine, and many people find it prefarable to
bunches of inline error handling after each and every call that returns an
HRESULT.
On the off chance that the original poster was trying to return error
information to a COM client, I would suggest looking into
CComCoClass::Error() function for a relatively easy way to provide rich
error information.
Jeff