Just to explain more about the context, this is how to reproduce:
Write a program around this code:
var
re:RegExp;
try
re:=CoRegExp.Create;
re.Pattern:='(';//is an invalid regex, but see below
re.Test('');
except
on e:Exception do
Caption:=e.ClassName+' '+e.Message;
end;
This will throw an Exception EOleError OLE error 800A139C
It does so because SysErrorMessage returns an empty string on this code and the EOleSysError constructor defaults to the SOleError resource string to return something.
Is there a winapi alternative to SysErrorMessage to get a hold of a better error description? If I google around a bit, the code does stand for a 'missing parentheses' error, but if there is a way I could get a (localized) description from the system, I would prefer using it, over having to add an enumeration of error-description constants to my project.
That's a COM error. To get a textual description call GetErrorInfo and then IErrorInfo.GetDescription. But don't be surprised if you don't get anything useful back.
IErrorInfo
interface, but many do. If you use thesafecall
calling convention to call the COM object methods, then Delphi automatically callsGetErrorInfo()
and raises anEOleException
that contains the extra error values fromIErrorInfo
- Remy Lebeau 2012-04-05 23:52