What 'L ' mean in this statement?

Started by
2 comments, last by wah_on_2 22 years ago
I found a DSound sample program from web but i don''t understand the meaning of ''L'' in the below statement. Can explain?
  
    m_pLoader->LoadObjectFromFile(CLSID_DirectMusicSegment, IID_IDirectMusicSegment8, L"sound.mid", (void **) &m_pBkgdMusic);

  
Thanks!
Advertisement
It means the string is Unicode, as opposed to ASCII. An example:


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?

  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