0

How can I set a string to have Right-to-Left (U+200F RIGHT-TO-LEFT MARK (RLM)) unicode char when editing the code itself?

Meaning, I have the given code:

CComPtr<MSForms::IControl> spISubjectControl;
spControls->_GetItemByName(_bstr_t(L"Subject"), &spISubjectControl);
if (spISubjectControl != NULL) {
    CComPtr<Outlook::_OlkTextBox> spSubject;
    hr = spISubjectControl.QueryInterface(&spSubject);
    if (spSubject != NULL) {
        CString subject = L"Some words in some RTL language";
        spSubject->put_Text(_bstr_t(subject));
    }
}

Unfortunately it is not enough to add the direction and the special character in the "advance properties" of the subject TextBox, it seems that once I change the content of the TextBox the direction is reset to LTR.

Please help :)

Thanks,

Nili

Nili
  • 1,963
  • 3
  • 20
  • 39

1 Answers1

0

Make sure that the subject string does contain the Unicode RLM character. Try with L"\u200F ‏Some words in some RTL language". If the \u200F escape sequence does not work, try \x200F instead.

wilx
  • 17,697
  • 6
  • 59
  • 114