Archived

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

L" -macro

This topic is 5048 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

Trying to integrate SAPI I stumbled using the L macro, which changes a char into a wide char. I shall pass a string as: Speak(L"helloWorld", ....) but what if I want to pass a CString a instead? I know it's stupid, but could not find the answer yet. How can I cast CString to wide char string? [edited by - MB on February 21, 2004 8:35:16 AM] [edited by - MB on February 21, 2004 8:35:42 AM]

Share this post


Link to post
Share on other sites
L is not a macro. It signifies that the following string consists of characters that are unsigned shorts. CString will store char''s if _UNICODE is not defined. If _UNICODE is defined, CString will store wchar_t.

You can use std::wstring if you need both types of strings in the same project.

Share this post


Link to post
Share on other sites