Hm, okay. I just wanted to test the waters here; I'll rework this to use a function that loads a string from a resource file. Does the help message itself look okay? I just used the message provided by the native dxdiag app, but I could rework it if there are issues with copyright or wine conventions.
On Thu, Sep 17, 2009 at 6:34 AM, Henri Verbeet <hverbeet@...http://www.nabble.com/user/SendEmail.jtp?type=post&post=25500104&i=0> wrote:
2009/9/17 Brian Nguyen <*mtxcoll*@...http://www.nabble.com/user/SendEmail.jtp?type=post&post=25500104&i=1>:
+/* 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.
Thanks for taking this on!