Home > Back-end >  Use memory mapping, speaking, reading and writing files, the program is turned off, mapped file cont
Use memory mapping, speaking, reading and writing files, the program is turned off, mapped file cont

Time:10-04

At the time of test memory mapped files, create an empty file, and then with an EDIT control in the program window, when the program execution, open the empty file, and read it to EDIT the content of the display, the user can also EDIT the content of the EDIT box, click ok button, the user input with memcpy function string copied to the address mapping, this should be achieved on a file,
Problem is: the program is turned off, I opened the empty file, want to see what's inside the content, such as user in the EDIT box enter "my world" and click ok after the procedure the string written to the file, then close, then I will open the are written to the file view, is a "m" is available characters, the back of the string where to go?
More strange is that although the contents of the file and user input the wrong before, but to run the program again, but still be able to read out in map "of" my world! The string in the EDIT box, shows the correct "my world!" Why is it that the string? Should not be closed program, the system will automatically update the mapping file content, how didn't update, hope can answer,

CodePudding user response:

No, no truth!

CodePudding user response:

May you the wrong file

CodePudding user response:

The file using hexadecimal display, doubt is wide character

CodePudding user response:

Why should be byte wide!