SetWindowText auf Editfenster?



  • Hi,
    ich will den Inhalt von einem Editfenster per SetWindowText verändern:

    static HWND			buttonText[5];
    
    buttonText[0] = CreateWindow(TEXT("edit"), NULL, WS_CHILD | WS_VISIBLE | ES_MULTILINE | WS_VSCROLL | WS_HSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL,
    				10, 80,680, 380, hwnd, NULL, ((LPCREATESTRUCT) lParam) -> hInstance, NULL);
    
    string neuerText("Das ist der neue Text");
    SetWindowText(buttonText[0], (LPCWSTR)neuerText.c_str());
    

    aber wenn ich das mache stehen in dem Editfenster nur chinesiche Schriftzeichen -.-
    Wie geht das richtig?
    MFG!



  • ANIS <> Unicode


  • Mod

    Weil Du ein Unicode Projekt hast.
    Der cast alleine ist schon der Fehler und hätte Dir die Ursache klar machen mussen.

    char ist eben nicht wchat_t!



  • std::basic_string<TCHAR> neuerText = TEXT("Das ist der neue Text");
    

Log in to reply