3
votes

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?

1

1 Answers

7
votes

The token which you are passing (%08lX) to the function is invalid, to format a value as Hexadecimal you must use the X char, and to specify the length use a dot followed by the count of desired chars like this %.8X

Check this sample

format('Error %.8X from FillBuffer!!!', [Result])