Invalid Error Message while utilising umanaged DLL

S

Sugan

Hi All,

I have a peculiar kind of issue after converting VC and VB code from
Visual studio 6.0 to Visual Studio 2005.

We have the business logic in the VC code which uses the ATL framework
and implements a COM server. VB code gives the GUI part of the project,

For reporting custom errors like invalid login, we use AtlReportError
method to report error from the VC code side.

While utilising the built VC dlls(unmanaged code), using VB 6.0
applications, we get the Error message text( like in the case of failed
login), exactly as we require. But while utilising the VC dlls in a VB
2005 application, instead of getting a error message we see "Exception
from HRESULT : 0x8004B411".

I do not know the reason cause for displaying such a error message
instead of the custom error message. Not sure whether i need to change
any settings in the project( any problem with interop dlls??).
I would appreciate your earnest help in this regard.

Thank you,
Sugan.
 
S

Sugan

Hi All,

I read through the few MSDN
posts(http://blogs.msdn.com/jaredpar/archive/2005/05/11/416300.aspx)
and also read through COM and .NET Interoperability by ANDREW TROELSEN
pdf. As i'm only a beginner in COM & ATL programming, I could
understand very till from the documents.

This is my current understanding. I need to implement IErrorInfo
interface in my COM class to pass on the error description. VB .Net
client would look for IErrorInfo interface and get the error
description from the interface.

My project has classes like this.

CMyComClass which inturn implements IRemoteNetwork and
ISoftPhoneInterface.

Exceptions from CMyComClass methods return the required error message
when the instance of CMyComClass is utilised in VB .Net client. Where
as when VB .Net client calls a method from IRemoteNetwork(implemented
in CMyComClass), the exception returns only HRESULT error instead of
the required error description. So I think that i should implement the
IErrorInfo interface in CMyComClass.

Please let me know if my understanding is correct.

Thank you,
Sugan.
 
S

Sugan

Hi Group,

Any ideas??
Hi All,

I read through the few MSDN
posts(http://blogs.msdn.com/jaredpar/archive/2005/05/11/416300.aspx)
and also read through COM and .NET Interoperability by ANDREW TROELSEN
pdf. As i'm only a beginner in COM & ATL programming, I could
understand very till from the documents.

This is my current understanding. I need to implement IErrorInfo
interface in my COM class to pass on the error description. VB .Net
client would look for IErrorInfo interface and get the error
description from the interface.

My project has classes like this.

CMyComClass which inturn implements IRemoteNetwork and
ISoftPhoneInterface.

Exceptions from CMyComClass methods return the required error message
when the instance of CMyComClass is utilised in VB .Net client. Where
as when VB .Net client calls a method from IRemoteNetwork(implemented
in CMyComClass), the exception returns only HRESULT error instead of
the required error description. So I think that i should implement the
IErrorInfo interface in CMyComClass.

Please let me know if my understanding is correct.

Thank you,
Sugan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top