• <small id='4euv9'></small><noframes id='4euv9'>

    <i id='4euv9'><tr id='4euv9'><dt id='4euv9'><q id='4euv9'><span id='4euv9'><b id='4euv9'><form id='4euv9'><ins id='4euv9'></ins><ul id='4euv9'></ul><sub id='4euv9'></sub></form><legend id='4euv9'></legend><bdo id='4euv9'><pre id='4euv9'><center id='4euv9'></center></pre></bdo></b><th id='4euv9'></th></span></q></dt></tr></i><div id='4euv9'><tfoot id='4euv9'></tfoot><dl id='4euv9'><fieldset id='4euv9'></fieldset></dl></div>
    <tfoot id='4euv9'></tfoot>
          <bdo id='4euv9'></bdo><ul id='4euv9'></ul>
        <legend id='4euv9'><style id='4euv9'><dir id='4euv9'><q id='4euv9'></q></dir></style></legend>

      1. 有没有办法使用 win API 获取 HRESULT 值的字符串表

        时间:2023-08-01
        <legend id='RtsEc'><style id='RtsEc'><dir id='RtsEc'><q id='RtsEc'></q></dir></style></legend>

        <small id='RtsEc'></small><noframes id='RtsEc'>

            • <tfoot id='RtsEc'></tfoot>
                <bdo id='RtsEc'></bdo><ul id='RtsEc'></ul>

              • <i id='RtsEc'><tr id='RtsEc'><dt id='RtsEc'><q id='RtsEc'><span id='RtsEc'><b id='RtsEc'><form id='RtsEc'><ins id='RtsEc'></ins><ul id='RtsEc'></ul><sub id='RtsEc'></sub></form><legend id='RtsEc'></legend><bdo id='RtsEc'><pre id='RtsEc'><center id='RtsEc'></center></pre></bdo></b><th id='RtsEc'></th></span></q></dt></tr></i><div id='RtsEc'><tfoot id='RtsEc'></tfoot><dl id='RtsEc'><fieldset id='RtsEc'></fieldset></dl></div>

                    <tbody id='RtsEc'></tbody>

                1. 本文介绍了有没有办法使用 win API 获取 HRESULT 值的字符串表示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  win API 中是否有一个函数可以用来提取 HRESULT 值的字符串表示?

                  Is there a function in win API which can be used to extract the string representation of HRESULT value?

                  问题是并非所有返回值都记录在 MSDN 中,例如 ExecuteInDefaultAppDomain() 函数没有记录为返回0x80070002 - 系统找不到指定的文件.",但是,它确实如此!所以,我想知道是否有一个函数可以在普通情况下使用.

                  The problem is that not all return values are documented in MSDN, for example ExecuteInDefaultAppDomain() function is not documented to return "0x80070002 - The system cannot find the file specified.", however, it does! Therefore, I was wondering whether there is a function to be used in common case.

                  推荐答案

                  您可以使用 _com_error:

                  _com_error err(hr);
                  LPCTSTR errMsg = err.ErrorMessage();
                  

                  如果您出于任何原因不想使用 _com_error,您仍然可以查看其源代码,看看它是如何完成的.

                  If you don't want to use _com_error for whatever reason, you can still take a look at its source, and see how it's done.

                  不要忘记包含标题 comdef.h

                  这篇关于有没有办法使用 win API 获取 HRESULT 值的字符串表示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:malloc() 与 HeapAlloc() 下一篇:如何有效地杀死 C++ (Win32) 中的进程?

                  相关文章

                  最新文章

                2. <small id='6C4tc'></small><noframes id='6C4tc'>

                  <i id='6C4tc'><tr id='6C4tc'><dt id='6C4tc'><q id='6C4tc'><span id='6C4tc'><b id='6C4tc'><form id='6C4tc'><ins id='6C4tc'></ins><ul id='6C4tc'></ul><sub id='6C4tc'></sub></form><legend id='6C4tc'></legend><bdo id='6C4tc'><pre id='6C4tc'><center id='6C4tc'></center></pre></bdo></b><th id='6C4tc'></th></span></q></dt></tr></i><div id='6C4tc'><tfoot id='6C4tc'></tfoot><dl id='6C4tc'><fieldset id='6C4tc'></fieldset></dl></div>

                    <tfoot id='6C4tc'></tfoot>

                      <legend id='6C4tc'><style id='6C4tc'><dir id='6C4tc'><q id='6C4tc'></q></dir></style></legend>
                        <bdo id='6C4tc'></bdo><ul id='6C4tc'></ul>