Based on your comment you probably want to use the Process Class. I assume you want to write something to a different program. You will need to set the ProcessStartInfo.RedirectStandardInput Property to true. Look at the sample code in the documentation. Also if you need to also get output from the other program then see How to redirect Standard Input/Output of an application - CodeProject.
How can i uninclude a header int C++
So, obviously, there is a
#include function in c/c++, but I want to UNinclude a header. Does anyone know how?
Can you give a specific example of what you are trying to accomplish?
Generally, headers can be included or omitted by using conditional compilation.
#ifdef INCLUDE_IT #include "Someheader.h" #endif
But unlike #define/#undef for macros the preprocessor has no such support for header files.
Sign in to comment
Sort by: Most helpful
As other has already mentioned that you can use preprocessor directory to control your include file . But I am still not sure if I get your question. What are you trying to accomplish here. Because you can have hook in your other application and you can trap mouse click event and based on your click your preprocessor can act the way you want .
But In your question I still didn't get "once you click the mouse in the win32 app project in the solution, it outputs something in another console app project" then where this include def/undef is coming in picture.
You cannot automatically undo everything that an
#includehas done. You can however selectively and explicitly undo much of what it has done, although experts will say to use a different solution to any problem. So as has been said already, please provide specific details of what you need to do. Note that
#includeis not a function, it is a pre-processor statement.
Ok. So I am making it so that in my solution, once you click the mouse in the win32 app project in the solution, it outputs something in another console app project. so I want to change the header, then sort of uninclude it.