Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suppress console output from external code

Status
Not open for further replies.

wapoc

Programmer
Jan 29, 2003
14
FR
Hi,

Apologies if this is a daft question but I'm fairly new to this. My Java code uses the JNI to call a C++ DLL wrapper which I wrote, that in turns calls some pre-written C++ code from elsewhere.

The latter does a lot of information output to the console from which the Java program was started. I'd like to stop this (redirect it to null or a file) without modifying that code, but don't know if I can.

Any ideas? Cheers!

Rob
 
Windows: yourprog.exe 2> nul > nul
UNIX: ./yourprog 2> /dev/null > /dev/null
 
Thanks, but I'm aware of how you can pipe output using the console, which is exactly the effect that I'm after. However this is a DLL, hence the problem...
 
Create an additional .exe, that does nothing, but calls your .dll code. In your main application call this external .exe using something like
system("calldll.exe > logfile.log");
and analyse contents of file logfile.log then.
Windows tool rundll32.exe could be usefull too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top