 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Rob Guest
|
Posted: Tue Dec 21, 2004 4:23 pm Post subject: Get COM Error Description |
|
|
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
|
Posted: Wed Dec 22, 2004 12:35 pm Post subject: Re: Get COM Error Description |
|
|
Is this the right group in which to post this question?
|
|
| Back to top |
|
 |
|
|
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
|
|