2009/9/17 Brian Nguyen <[email protected]>:
> +/* Thread-safe function for converting to wide char strings at runtime */
> +LPWSTR PrintWide(LPWSTR buf, size_t len, const char *s)
> +{
> + size_t i;
> + for (i = 0; i < len && *s != '\0'; i++, s++) {
> + buf[i] = *s;
> + }
> + return buf;
> +}
That doesn't do what you want, you should use MultiByteToWideChar() to
convert to WCHAR. However, I don't think you want to hardcode the
strings in the first place, you should load them from the resources so
they can be translated. Also, functions like that which are only used
in the current file should be static.