Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Redirecting stdout

Posted on 1999-07-02
4
Medium Priority
?
496 Views
Last Modified: 2008-02-20
Hi,
I have some DLLs (not source code) that prints to the stdout. I will call DLL in visual basic and it can not print to the stdout. So, I will write my own DLLs calling those DLL and in my DLL I will redirect stdout to null device.
does this solution works? if it works, how can I redirect stdout to the null device?
thanks
0
Comment
Question by:unsa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1198970
Have you tried freopen?
freopen("nul", "wa", stdout);
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1198971
Try SetStdHandle API
0
 

Author Comment

by:unsa
ID: 1198972
kangaroo,
It seems working
I will accept your answer but how can I restore the stdout.?
and send your comment as answer.
mikep,
to use SetstdHandle, I need to know handle for nul device, But I do not know.Thanks
0
 
LVL 7

Accepted Solution

by:
KangaRoo earned 120 total points
ID: 1198973
Hmm.
freopen("con", "wa", stdout);
Yes, we learn something new everyday :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question