I’ll clarify just in case that this is a function . I noticed that it skips the character to move to another line: "\n" . How to make a transition for this function?
UPDATE:
Code example:
int main() { string PathEXE = "C:\\Projects\\tests\\Release\\"; auto file = CreateFileA((PathEXE+"logtest.txt").c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (file == INVALID_HANDLE_VALUE) { printf("ERROR %x \n", GetLastError()); std::cout << "\nRELOAD NEEDED. LOG ERROR";//messagebox } DWORD size = 0; std::string text = "\n1"; for (int i = 0; i < 100; ++i) { WriteFile(file, text.c_str(), (text).size(), &size, NULL); size += (text).size(); } return 0; } UPDATE2: When I wrote the question, I opened the file with a regular notepad (Windows 7). Now opened Notepad ++ and there are transitions to another line of Oo. how so?
WriteFileinformation that some characters are skipped. It makes sense to assume that the bug is in your code. Show how exactly you write and how you check the result. (Mandatory reference: minimum reproducible example .) - VladD\r\n, Notepad ++ understands both entries and windows and * nix - Grundy