What is the function to turn an error number into an error message?

  • Thread starter Thread starter ToddAndMargo3
  • Start date Start date
T

ToddAndMargo3

Guest
Hi All,

https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-

ERROR_FILE_NOT_FOUND
2 (0x2)
The system cannot find the file specified.

When I already have the error number (2), what is the proper function to use to get the error string ("The system cannot find the file specified")?

Is it this one?

FormatMessageW function (winbase.h) - Win32 apps

The "va_list" seems to be a stopper. I just want back the string and in the system's default language.

Many thanks,
-T

Continue reading...
 
Back
Top