Open TY-cc opened 2 months ago
The problem is probably that you are not writing in binary mode, so your fstream is corrupting the saved data with some newline translations. To fix, specify std::ios::binary
as the mode
when opening your streams. To be clear, writing the request doesn't produce a "text file" in the sense that your file naming misleadingly suggests.
I try to write the content that needs to be communicated into the document, and then complete the communication process by moving the document. For example, in the receiver, I want to use the save method of
SenderOperationParms
to writeParamsRequest
into the document, and the sender uses the load method to readParamsRequest
from the document. But it failed, and theParamsRequest
after reading can't be used normally. Code as follow: error as :