- size_t len = m_filenames[i].Len();
- memcpy(pbuf, m_filenames[i], len);
- pbuf += len;
- *pbuf++ = wxT('\0');
+ size_t len;
+#if wxUSE_UNICODE_MSLU
+ if ( sizeOfChar == sizeof(char) )
+ {
+ wxCharBuffer buf(wxConvFileName->cWC2MB(m_filenames[i]));
+ len = strlen(buf);
+ memcpy(pbuf, buf, len*sizeOfChar);
+ }
+ else
+#endif // wxUSE_UNICODE_MSLU
+ {
+ len = m_filenames[i].length();
+ memcpy(pbuf, m_filenames[i].c_str(), len*sizeOfChar);
+ }
+
+ pbuf += len*sizeOfChar;
+
+ memset(pbuf, 0, sizeOfChar);
+ pbuf += sizeOfChar;