|
Previous Top Next |
Prototype: | (<*Long pErrorCode>,<String pLocation>),String |
[pErrorCode] | Optional Parameter that receives the API error code value. |
[pLocation] | Optional Parameter that has a prefix for the error, such as "Mylocation: (183) Cannot create a file when that file already exists." |
Returns | Returns a formatted error message from the operating system. |
This method checks for an error after calling any Windows API function and returns a formatted error message and optionally an error code. This is very useful method to use when writing API functions to check for errors and get the error message text as the operating system formats it. The function first retrieves the last error from the operating system with the GetLastError api function. It then uses the FormatMessage api to format the error message text and return it to the calling code. The formatting is done with FORMAT_MESSAGE_FROM_SYSTEM + FORMAT_MESSAGE_MAX_WIDTH_MASK
Example:
(none)
See also: