Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOSDK Error Handling question

Status
Not open for further replies.

oschmitt

Programmer
Sep 17, 2002
15
US
Hello everybody,

I am writing a C++/COM application that interacts with the BOSDK. Specifically, it reads and writes information into universes objects using the designer sdk.

What I would like to learn is how to trap the exceptions that are occasionnaly generated by the sdk.
example:
IUniversePtr universe = <...>
try {
universe->LongName = &quot;some long name&quot;;
universe->SaveAs(&quot;MYUNV.UNV&quot;);
} catch (_com_error& error) {
HRESULT res = error.Error();
// how do I decode here the error code
}

In this particular code, no connection was set to this newly created universe, and the exception gets generated when trying to save the universe.
But is there a generic way to decode error messages, and get a plain-english error message?
Thanks for your help.

Olivier Schmitt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top