Board index » cppbuilder » What gets thrown when using wrappers?

What gets thrown when using wrappers?

I posted this in the language group and realized that it belongs
here so don't yell at me !! <g>

Currently I'm using a dll that I imported without wrappers and
have to check a returned HRESULT for each method called.

If imported using wrappers, the methods won't return a HRESULT
but rather throw something instead.

Does anyone know what will be thrown and how to catch it other
than using the obligitory catch(...) ?

Will it also throw an error code (the HRESULT) ?

~ JD

 

Re:What gets thrown when using wrappers?


Quote
JD wrote:
> ~ JD

Examine utilcls.h file - at the top of it you will see some macros and
functions that could be of use/interest to you.

hth,
.a

Re:What gets thrown when using wrappers?


Quote
"JD" <nos...@nospam.com> wrote in message

news:3e8d84cf$1@newsgroups.borland.com...

Quote
> Does anyone know what will be thrown

Usually a EOleSysError descendant, such as EOleException.

Quote
> and how to catch it other than using the
> obligitory catch(...) ?

A catch() is required, but the wrappers always throw a VCL Exception, so
catch that instead:

    catch(EOleSysError &e)
    catch(EOldException &e)
    catch(Exception &e)
    ...

Quote
> Will it also throw an error code (the HRESULT) ?

If EOleSysError or a descendant is thrown, then yes.  The HRESULT will be
one of the properties of the Exception.

Gambit

Re:What gets thrown when using wrappers?


Other Threads