none
Convert a String ^ without losing the data RRS feed

  • Question

  • Hello,

    i have this code to dispaly a arabic text in a not-pad window:

     

    String^ result="مرحبا"; // arabic lettre to say Hello 

    marshal_context cont; 
    LPCSTR output = cont.marshal_as<const TCHAR*>(result); //to convert " result " type I used a variable intermediare "output"
     int nCharsR = SendMessage(hWnd, WM_SETTEXT, 10000, (LPARAM)output);

    this code displays question marks (?????) in the notepad window.

    I located the problem and she is in this line:

    LPCSTR output = cont.marshal_as<const TCHAR*>(result);

    there is a data loss during the type conversion.

    Any help please?

    thank you 

    Tuesday, July 3, 2018 10:23 AM

All replies