wvsprintf

  int wvsprintf(lpOut, lpFmt, lpvParms)    
  LPTSTR lpOut;    
  LPCTSTR lpFmt;    
  CONST VOID *lpvParms;    

The wvsprintf function formats and stores a series of characters and values in a buffer. The items pointed to by the argument list are converted and output according to the corresponding format specification in the format string. The function appends a NULL to the end of the characters written, but the return value does not include the terminating null character in its byte count.

Parameters

lpOut

Points to a null-terminated string to receive the formatted output.

lpFmt

Points to a null-terminated string that contains the format-control string. In addition to ordinary ASCII characters, a format specification for each argument appears in this string. See the description of the wsprintf function, earlier in this chapter, for more information on the format specification.

lpvParms

Points to an array of words, each of which specifies an argument for the format-control string. The number, type and interpretation of the arguments depend on the corresponding format-control character sequences in lpFmt. Each character or word-sized integer (%c, %d, %x, %i) requires one word in lpvParms. Long integers (%ld, %li, %lx) require two words, the low-order word of the integer followed by the high-order word. A string (%s) requires two words, the offset followed by the segment (which together make up a far pointer).

Return Value

The return value is the number of characters stored in lpOut, not counting the terminating NULL. If an error occurs, the function returns a value less than the length of lpFmt.

Comments

wvsprintf and wsprintf vary in how they handle number sizing.

wvsprintf works the same way that it did in Windows 3.0. %d prints word-size values, %ld prints long values.

wsprintf, on the other hand, is completely portable. It handles number sizes correctly based on the platform. For Windows32, therefore, %d prints long values.

See Also

wsprintf