We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.


Formats a message string using a variable argument list.

void FormatMessageV(
   PCXSTR pszFormat,
   va_list* pArgList


Points to the format-control string. It will be scanned for inserts and formatted accordingly. The format string is similar to run-time function printf-style format strings, except it allows for the parameters to be inserted in an arbitrary order.


Pointer to a list of arguments.

The function requires a message definition as input, determined by pszFormat. The function copies the formatted message text and a variable list of arguments to the CStringT object, processing any embedded insert sequences if requested.


FormatMessageV calls CStringT::FormatMessage, which attempts to allocate system memory for the newly formatted string. If this attempt fails, a memory exception is automatically thrown.

For more information, see the Windows FormatMessage function in the Windows SDK.

Header: cstringt.h