相关疑难解决方法(0)

我应该如何在C++中正确使用FormatMessage()?

没有:

  • MFC
  • ATL

如何使用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)

c++ windows error-handling formatmessage

84
推荐指数
5
解决办法
5万
查看次数

如何将 HRESULT 转换为错误描述?

比如说,如果我有一个因HRESULT代码而失败的 WinAPI 。有没有办法将其转换为错误描述字符串?

c++ windows winapi hresult

2
推荐指数
1
解决办法
8240
查看次数

标签 统计

c++ ×2

windows ×2

error-handling ×1

formatmessage ×1

hresult ×1

winapi ×1