AnsiUpperBuff

3.0

  UINT AnsiUpperBuff(lpszString, cbString)    
  LPSTR lpszString; /* address of string to convert */
  UINT cbString; /* length of string, */  

The AnsiUpperBuff function converts a character string in a buffer to uppercase.

Parameters

lpszString

Points to a buffer containing one or more characters.

cbString

Specifies the number of bytes in the buffer identified by the lpszString parameter. If cbString is zero, the length is 64K (65,536).

Return Value

The return value specifies the length of the converted string if the function is successful.

Comments

The language driver makes the conversion for the current language (the one selected by the user at setup or by using Control Panel). If no language driver is selected, Windows uses an internal function.

Example

The following example uses the AnsiUpperBuff function to convert two strings to lowercase for a non–case-sensitive comparison:

/*
 * Convert both the subject and target strings to uppercase before
 * comparing.
 */

AnsiUpperBuff(pszSubject, (UINT) lstrlen(pszSubject));
AnsiUpperBuff(pszTarget, (UINT) lstrlen(pszTarget));

while (*pszTarget != '\0') {
    if (*pszTarget != *pszSubject)
        return FALSE;
    pszTarget = AnsiNext(pszTarget);
    pszSubject = AnsiNext(pszSubject);
}

See Also

AnsiLower, AnsiUpper