cancel
Showing results for 
Search instead for 
Did you mean: 

Error in UI Api with _com_issue_errorex

Former Member
0 Kudos

Hi,

I use the ui api with ms visual studio c++.

If i produce an error (ex. try to connect to sap client while no client is running) the comissue_errorex in sapbouicom.tli should print an error message. But the only thing comissue_errorex does, is to create an unhandled exception. so i've never the possibility to get the error message and to know whats wrong.

thanks for help

Accepted Solutions (1)

Accepted Solutions (1)

former_member185703
Active Contributor
0 Kudos

Hi,

First of all, please note that when a exception is created by the callee, the caller is responsible for catching it!

Unless you implement exception handling around the call e.g. to UI API, e.g. the Microsoft Visual Studio debugger will always report an "Unhandled exception". This has nothing to do with what bothers you.

Instead you should wrap some exception handler around your call - like this:

try

{

// connect to the SBO GUI application

HRESULT hr = gui->Connect (<connection string>);

if (FAILED(hr) ... <handle failure - except exception>

... <Get application object etc.> ...

}

// handle exception here...

catch (_com_error& e)

{

::MessageBox(this->m_hWnd, e.Description(), "Exception occurred", MB_OK | MB_ICONERROR);

}

...and see the information about the exception ...

HTH,

Frank

Answers (0)