Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problem when i want to use document to replace the communication. #77

Open
TY-cc opened this issue Jul 23, 2024 · 1 comment
Open

Comments

@TY-cc
Copy link

TY-cc commented Jul 23, 2024

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 write ParamsRequest into the document, and the sender uses the load method to read ParamsRequest from the document. But it failed, and the ParamsRequest after reading can't be used normally. Code as follow:
image
error as :
image

@kimlaine
Copy link
Contributor

kimlaine commented Aug 23, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants