Skip to Content
author's profile photo Former Member
Former Member

Error in UI Api with _com_issue_errorex

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Dec 20, 2004 at 10:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.