• Advertisement

Archived

This topic is now archived and is closed to further replies.

What 'L ' mean in this statement?

This topic is 5814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Thanks, however, if i have a
char filePath[100] = "c:\sound01.wav";

how can i convert is to Unicode?

Share this post


Link to post
Share on other sites

  
WCHAR Name[100];

MultiByteToWideChar(CP_ACP, 0, filePath, -1, (unsigned short *)Name, 100);


This should do the job.

Share this post


Link to post
Share on other sites

  • Advertisement