Translate error codes to string to display

前端 未结 7 1253
无人共我
无人共我 2021-01-03 03:18

Is there a common way in C++ to translate an error code to a string to display it?

I saw somewhere a err2msg function, with a big switch, but is that re

相关标签:
7条回答
  • 2021-01-03 03:59

    In windows you can use FormatMessage(...) function either with error code return by GetLastError() function or directly to the suspected area.

    Please see below links for examples.

    http://msdn.microsoft.com/en-us/library/ms679351(v=VS.85).aspx

    http://msdn.microsoft.com/en-us/library/ms680582(v=VS.85).aspx

    I hope this will help you.

    0 讨论(0)
提交回复
热议问题