Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9272603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:54:39+00:00 2026-06-18T15:54:39+00:00

I have a third party COM component with its c++ interface in VC++. I

  • 0

I have a third party COM component with its c++ interface in VC++. I am getting a crash in the call below which is crashing my application. How can I recover gracefully from this function which is not really part of my application?

inline _RecordsetPtr IGLibMgr::GetLibInfo ( _bstr_t LibPath ) {
    struct _Recordset * _result = 0;
    HRESULT _hr = raw_GetLibInfo(LibPath, &_result);
    if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
    return _RecordsetPtr(_result, false);
}

It crashes in the last line. I don’t think I can modify this code since it’s third party COM stuff. What options do I really have? I just want to bring up message box to user and return gracefully.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T15:54:40+00:00Added an answer on June 18, 2026 at 3:54 pm

    If you’re not already doing this in your code, you need to be from the caller-side:

    try
    {   // setup your invoke for your object...
        IGLibMgrPtr spMgr = ....
        bstr_t bstrPath = ....
    
        // invoke your call.
        _RecordsetPtr spRS = spMgr->GetLibInfo(bstrPath);
    
        ... continue normal processing ...
    }
    catch(const _com_error& ce)
    {
        // handle your error here.
    }
    

    This is important on multiple levels. The most obvious being that not only can your IGLibMgr member throw an exception, so can the bstr_t allocation, etc. When using #import code from a COM DLL, get used to this format if using generated smart-pointers from the comutil library of MSVC.

    Note: The _com_error class provides several members for obtaining why the error happened, including the HRESULT, error description string, etc. It even provides access to the IErrorInfo created by the error-returning object if it is so-nice as to provide that level of detail.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java application which uses a third-party COM component through a Java-COM
I have a third-party, closed source application that exports a COM interface, which I
I am working with a third-party COM component (i.e. do not have its code).
I have a third-party library (the interface to Xerox's Finite State tools) which come
I have a third party COM component (they don't offer a .Net assy), that
I have a crash in a third party component . It is clear that
session.identify is a third party COM API that I call and have no access
I have a class library which is called through COM from a Third Party
I have to use third party, unmanaged COM dll into my .NET application. I
I have an windows application that is tightly coupled with a third party COM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.