m_pLoader->LoadObjectFromFile(CLSID_DirectMusicSegment, IID_IDirectMusicSegment8, L"sound.mid", (void **) &m_pBkgdMusic);
What 'L ' mean in this statement?
I found a DSound sample program from web but i don''t understand the meaning of ''L'' in the below statement. Can explain?
Thanks!
It means the string is Unicode, as opposed to ASCII. An example:
wchar_t is just a typedef for "unsigned short".
codeka.com - Just click it.
char *AsciiString = "Ascii String";
wchar_t *UnicodeString = L"Unicode String";
wchar_t is just a typedef for "unsigned short".
codeka.com - Just click it.
Thanks, however, if i have a
char filePath[100] = "c:\sound01.wav";
how can i convert is to Unicode?
char filePath[100] = "c:\sound01.wav";
how can i convert is to Unicode?
WCHAR Name[100]; MultiByteToWideChar(CP_ACP, 0, filePath, -1, (unsigned short *)Name, 100);
This should do the job.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement