のような匿名パイプに書き込む必要double (*fun)(double)
がありますが、次のようにWriteFile(pipe, fun, 4, written_bytes, 0)
すると、パイプレシーバー while でエラーが発生しますReadFile(read_pipe, fun, 4, written_bytes, 0)
。これを行う方法はありますか?
考えがある。同じタイプのフィールドを持つ構造体を作成できます。
struct Foo
{
double (*f)(double);
};
そして、私はそれを書きますWriteFile(hWritePipe_StdIN, &to_process, sizeof(Foo), &bytes, 0);
が、パイプレシーバーがデータの読み取りを終了しないという問題があります。
ReadFile(hReadPipe, &to_process, sizeof(Foo), &bytes, 0);