Write a C++ program for getting the last error code generated during execution of a process, convert
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a C++ program for getting the last error code generated during execution of a process, convert this code into a user-understandable language format using the Windows FormatMessage() API and display the message along with the error code.
Hints:
1. Include everything.h> header file in your program and use the Windows API for getting last error code.
2. Set the dwFlags parameter in FormatMessage() API as FORMAT_MESSAGE_ALLOCATE_BUFFER
3. In language selection, set the parameter for system default language ID
4. Neglect the Error-reporting code. Marks will be deducted on including extra or irrelevant code.
Posted Date: