I have a Delphi 6 application that uses the DSPACK component library. That library prints a log line when in debug mode whenever a particular DirectShow operation fails. Here’s the relevant souce code line:
format('Error %08lX from FillBuffer!!!', [Result])
Unfortunately this line leads to an EConvertError Exception in SysUtils.ConvertErrorFmt(). What is the correct format specifier to use when trying to print an HRESULT correctly in hexadecimal format?
The token which you are passing (
%08lX) to the function is invalid, to format a value as Hexadecimal you must use theXchar, and to specify the length use a dot followed by the count of desired chars like this%.8XCheck this sample