string nach char
-
hmm achso hast de UNICODE an? dann machs anders:
LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; switch (message) { case WM_PAINT: { HDC hDC = BeginPaint (hwnd, &ps); RECT rect_client; GetClientRect (hwnd, &rect_client); std::wifstream file_stream(L"C:\\Roulettscore.sc", std::ios::in); std::wstring string_content; std::wstring string_in; if (file_stream.is_open() == true || file_stream.good() == true) { while (file_stream.eof() == false) { std::getline(file_stream, string_in); string_content += "\n"; string_content += string_in; } DrawText(hDC, string_content.c_str(), string_content.length(), &rect, DT_SINGLELINE); file_stream.close(); } EndPaint (hwnd, &ps); return 0; } case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }und vor getline gehört ein std:: ... und bei den restlichen Funktionen halt die UNICODE Variante nehmen ...
-
So das tut es, ich sehe jetzt den Inhalt (nur ohne Zeilenumbrüche, obwohl die Datei welche hat) kann man das noch ändern oder ist das wieder ein riesiges umkramen??
-
habs angepasst ...