![]() |
| | #1 |
| Registered User Join Date: Feb 2008
Posts: 93
| Avoiding an external dll to printf 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 |
| Kempelen is offline | |
| | #2 |
| Registered User Join Date: Sep 2006
Posts: 2,512
| 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. |
| Adak is offline | |
| | #3 |
| Registered User Join Date: Jan 2009
Posts: 30
| 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. |
| DeadPlanet is offline | |
![]() |
| Tags |
| dll, printf |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Math calculator and compiler errors | littlefermat245 | C Programming | 2 | 10-12-2009 09:45 PM |
| I have some questions :( | geekrockergal | C Programming | 19 | 02-01-2009 09:44 AM |
| C++ std routines | siavoshkc | C++ Programming | 33 | 07-28-2006 12:13 AM |
| structs and passing information to and from functions | Sandy | C Programming | 4 | 04-01-2003 12:49 AM |
| Ask about these "unresolved external symbol" error | ooosawaddee3 | C++ Programming | 1 | 06-29-2002 11:39 AM |