BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get COM Error Description

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Rob
Guest





PostPosted: Tue Dec 21, 2004 4:23 pm    Post subject: Get COM Error Description Reply with quote



Hello All,

I have a SDK I am using via a type library.

It seems to throw either EOleException or EOleSysError exception types.

I get the error code by doing something like this:

try
//Do someting
except
on E:EOleException do
begin
ErrNo := HResultToErrorNumber( E.ErrorCode);
//I have to do get the error description for over 100 codes
case ErrNo of
5001:
begin
ShowMessage( 'A stupid error message');
end
....
end;
end;
end;

The SDK documentation give a Error Code and corresponding Error Message
for every exception it generates. It also states this:

/*All methods and properties of objects in Scanning Services return an
HRESULT (as all COM objects do). An OLE/COM HRESULT is a bit-packed
structure whose members may be de-referenced using macros provided by
OLE. COM objects in Scanning Services also support the IErrorInfo
interface. This interface exposes methods such as GetDescription,
allowing clients to extract error details from OLE/COM servers.*/

Finally, my question is how to get the error description without having
to do what I have shown in my code sample because there are many
exceptions that my be raised via the SDK?

Thanks,

Rob

Back to top
Rob
Guest





PostPosted: Wed Dec 22, 2004 12:35 pm    Post subject: Re: Get COM Error Description Reply with quote



Is this the right group in which to post this question?

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.