[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details

AtlReportError not returning error string from c++ COM dll in c# application

Asked by axnst2 in Microsoft Visual C++.Net, C# Programming Language, Windows ATL / WTL / COM Programming

Tags: .NET COM Interop C++ AtlReportError

We have upgraded an old VB6 app to .NET C# and use en existing C++ COM dll.  Now in the VB6 app, when the C++ COM dll threw an exception with AtlReportError, the error string was picked up in the VB6 app and shown to the user providing them with a detailed error message.

Now using the exact same C++ COM dll in C# when the C++ COM dll throws an exception, we simply get back Exception from HRESULT: with no error message string.  The innerexception is also null.

We would prefer to not have to port the dll to managed C++ or do any re-writing of it since it is rather large and contains a fair amount of process logic.

The COM dll functions all work and the reference was added to the .NET project through the references dialog.  Is there some other setting I am missing or does AtlReportError not play nice with .NET COM interop?
[+][-]11/02/09 08:46 AM, ID: 25721007Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625