Hi Zhangrong,
+static inline unsigned int strlenW( const WCHAR *str ) +{ + const WCHAR *s = str; + while (*s) s++; + return s - str; +}
Is there some reason you can't just use lstrlenW? --Juan
Hmm, cause GetMenuStringW uses strlenW, so I just copy it.
2008/7/3 Juan Lang juan.lang@gmail.com:
Hi Zhangrong,
+static inline unsigned int strlenW( const WCHAR *str ) +{
- const WCHAR *s = str;
- while (*s) s++;
- return s - str;
+}
Is there some reason you can't just use lstrlenW? --Juan
Oh, I see, cross-test on Windows 95/98/Me maybe fail if uses lstrlenW.
See http://msdn.microsoft.com/en-us/library/ms647492(VS.85).aspx
Windows 95/98/Me: Although lstrlenW exists on Microsoft Windows 95/98/Me, it is supported by the Microsoft Layer for Unicode (MSLU) to give more consistent behavior across all Windows operating systems. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
2008/7/3 Huang, Zhangrong hzhrong@gmail.com:
Hmm, cause GetMenuStringW uses strlenW, so I just copy it.
Oh, I see, cross-test on Windows 95/98/Me maybe fail if uses lstrlenW.
Ah, right. Carry on. --Juan