468,256 Members | 1,458 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,256 developers. It's quick & easy.

Invalid Error Message while utilising umanaged DLL in VB .Net client

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??).

updated::
-------------
I also read through the few MSDN
postshttp://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.

But i do not have a clear picture to do this. So can someone post
sample code to accomplish this or explain in detail how should I
proceed further.

Thank you,
Sugan.

Dec 14 '06 #1
0 1054

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Nad | last post: by
6 posts views Thread by Steve Crawford | last post: by
3 posts views Thread by stephenedavis | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.