I have a free glute project, which calculates the voronoy mesh, launches freewill and then pulls the mesh .
Pre-Calculation ... Print ("spent% lf seconds \ n", (double) (clock () - start) / CLOCKS_PER_SEC); GlutInit (& amp; argc, argv); GlutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); GlutInitWindowSize (WIDTH, HEIGHT); // Window Glit Cut MakeWondo ("Voroneau"); // register handler glutDisplayFunc (display); Glute Reshapfunk (reshape); Gluteboardfunk (key); Glutman loop (); Return 0; ... Then the program works in console mode and then creates a freelual window. And I have a separate program that reads from the standout pipe attached to it. I am making a process with this parameter
STARTUPINFO si; Xeromamari (and, shape (SI)); Si.cb = Size (C); Si.dwFlags = STARTF_USESTDHANDLES; Si.hStdInput = stdinput.ReadPipe (); Si.hStdOutput = stdoutput.WritePipe (); Si.hStdError = stderror.WritePipe (); Stdoutput.duplicateReadPipe (); If (! CreateProcess ("Create: Process \\ \\ Study \\ Fate \\ Debug \\ voronoy.exe", // "C: \\ GnuWin32 \\ bin \\ ls.exe", zero, zero, zero , TRUE, (CREATE_SUSPENDED | CREATE_SEPARATE_WOW_VDM | CREATE_NO_WINDOW), NULL, NULL, & amp; si, and process_info) {throw ("!!!"); } DWORD w = restartthread (process_info.hThread); CloseHandle (process_info.hProcess); CloseHandle (process_info.hThread); And I have also tried standard Pipes example from MDDN.
The problem is that the program does not receive data from the pipes. I also have voronoy.exe & gt; The test.txt remains empty in Cmd.exe and test.txt. But if I run it without pipes - it works fine and I can see the output in the console.
The answer is simple. I just need to flush the SDD output by calling
Fflush (stdout);
Comments
Post a Comment