Redirect PrintMessage

More
5 years 11 months ago #1352 by wael
Redirect PrintMessage was created by wael
Hi,

I redirected cout from netgen to show on GUI, however, I cannot see output from PrintMessage calls
How is PrintMessage implemented and how can I redirect it please?

Thanks in advance

Regards

Wael
More
5 years 11 months ago #1354 by wael
Replied by wael on topic Redirect PrintMessage
I think I found a fix for this by redirecting stderr, not only stdout:

freopen (cout_file, "w", stdout);
setvbuf (stdout, NULL, _IONBF, 0);

freopen (error_file, "w", stderr);
setvbuf (stderr, NULL, _IONBF, 0);

Hope this helps somebody ;)
Time to create page: 0.090 seconds