home *** CD-ROM | disk | FTP | other *** search
- // strX.cpp : Implementation of CstrX
- #include "stdafx.h"
- #include "ATLstrX.h"
- #include "strX.h"
-
- #include <ctype.h> // for tolower()
- #include <stdlib.h>
-
- // CstrX
- // This function converts the BSTR pointed to by s to lower case.
- STDMETHODIMP CstrX::ATLstrlwrX(BSTR * s)
- {
- // BSTRs are passed as wide characters.
- // Also, in COM circumstances, they're null-terminated.
- wchar_t *p = (wchar_t *) *s;
-
- // Iterate over the BSTR and convert its characters
- // to lower case.
- while (*p)
- {
- *p = tolower(*p);
- p++;
- }
-
- return S_OK;
- }
-