+ if ( !help.IsEmpty() )
+ {
+ if ( hdr->code == TTN_NEEDTEXTA )
+ {
+ ttText->lpszText = (char *)help.c_str();
+ }
+#if (_WIN32_IE >= 0x0300)
+ else
+ {
+ // FIXME this is a temp hack only until I understand better what
+ // must be done in both ANSI and Unicode builds
+
+ size_t lenAnsi = help.Len();
+ #ifdef __MWERKS__
+ // MetroWerks doesn't like calling mbstowcs with NULL argument
+ size_t lenUnicode = 2*lenAnsi;
+ #else
+ size_t lenUnicode = mbstowcs(NULL, help, lenAnsi);
+ #endif
+
+ // using the pointer of right type avoids us doing all sorts of
+ // pointer arithmetics ourselves
+ wchar_t *dst = (wchar_t *)ttText->szText,
+ *pwz = new wchar_t[lenUnicode + 1];
+ mbstowcs(pwz, help, lenAnsi + 1);
+ memcpy(dst, pwz, lenUnicode*sizeof(wchar_t));
+
+ // put the terminating _wide_ NUL
+ dst[lenUnicode] = 0;
+
+ delete [] pwz;
+ }
+#endif // _WIN32_IE >= 0x0300