
throwing exception from COM and catching it in ASP
Never ever throw an exception across COM boundaries. COM component
should return failed HRESULT, and optionally set up IErrorInfo object.
#import-generated smart wrappers convert those failed HRESULTs to C++
exceptions on the client side.
See AtlReportError, CComCoClass::Error
--
With best wishes,
Igor Tandetnik
"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
Quote:
> I am trying to throw some exception in the component
> throw _com_error(E_FAIL);
> or
> ICreateErrorInfo *err_inf;
> IErrorInfo *err;
> HRESULT hr;
> hr = CreateErrorInfo(&err_inf);
> err_inf->SetDescription(desc);
> err_inf->QueryInterface(IID_IErrorInfo, (LPVOID FAR*) &err);
> throw _com_error(0, err);
> and trying to catch it in the ASP
> catch(e)
> {
> res = e.description;
> }
> but it gives Out of memory, although I pass desc="blablabla" lets say
> Any ideas?