FormatMessage is an API provided by Windows that gets the text information for the error code returned when calling the Windows API, previously used in VB, but not in C #, and is largely not familiar with some of the rules that Windows API calls in C #. Recently, VC + + WIN32 development of mobile phone program suddenly have a great interest, pick up N-long use of C + +, of course, often need to deal with Windows API, write C # write more, and then use VB and a bit unaccustomed, so in C # cut this method. Why not use it directly in C + +? Well, the phone debugging more annoying, do not want to write too much code, C # to use up or to be convenient and much faster. DWORD WINAPI FormatMessage (in
1. Detailed introduction to calling the FormatMessage API in C #
Summary: FormatMessage is a Windows-provided API to get the text message for the error code returned when calling the Windows API, which was used previously in VB, but not in C #, mostly not familiar with the Windows API in C # Some of the rules that are called in. Recently, VC + + WIN32 development of mobile phone program suddenly have a great interest, pick up n-long use C + +, of course, also need to deal with Windows API frequently, write C # write more, and then use VB and
"Related question and answer recommendation":