Hi
My console application load a DLL via LoadLibrary. When calling this library the dll printf a few lines. Is it possible to avoid the dll to output printing at console from my program?
Thx
Hi
My console application load a DLL via LoadLibrary. When calling this library the dll printf a few lines. Is it possible to avoid the dll to output printing at console from my program?
Thx
You can print on a console window, without a dll. Whatever else the dll is doing for you, you'd have to replace that functionality, by using API calls.
You'll need the source code changed, of course.
Before you call the function, redirect stdin to a file (use freopen) and then change it back after calling the function. This function will create a file to redirect the text to, but you can just remove it afterwards.
There are probably other/better ways to do this but this is the only one I can think of at the moment. You may also be able to just change the mode so that the writes to stdin fail but that is most likely undefined.
EDIT: Come to think of it, I'm not 100% sure whether this method will work if the printf call is in another module, but it's worth a try.