Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个使用 DSPACK 组件库的 Delphi 6 应用程序。只要特定 DirectShow 操作失败,该库就会在调试模式下打印一条日志行。这是相关的源代码行:
format('Error %08lX from FillBuffer!!!', [Result])
不幸的是,这一行会导致 SysUtils.ConvertErrorFmt() 中出现 EConvertError 异常。尝试以十六进制格式正确打印 HRESULT 时使用的正确格式说明符是什么?
您将 ( %08lX) 传递给函数的令牌无效,要将值格式化为十六进制,您必须使用Xchar,并指定长度,使用点后跟所需字符的计数,如下所示%.8X
%08lX
X
%.8X
检查这个样本
format('Error %.8X from FillBuffer!!!', [Result])