没有:
如何使用FormatMessage()
获取错误文本HRESULT
?
HRESULT hresult = application.CreateInstance("Excel.Application");
if (FAILED(hresult))
{
// what should i put here to obtain a human-readable
// description of the error?
exit (hresult);
}
Run Code Online (Sandbox Code Playgroud) 比如说,如果我有一个因HRESULT
代码而失败的 WinAPI 。有没有办法将其转换为错误描述字符串?