Creating a console window from a DLL for debugging aims
I have implemented a DLL (C++, VisualStudio, Windows), which extends function of an another program (further – main program
).
I don’t know internal architecture of the main program
, except it is GUI-program and doesn’t use console windows itself.
DLL creates console window and uses it to produce output for debugging aims (std::cout/wcout).
The interaction of the DLL and main program
occurs through some exported functions in DLL. The interaction works good, but in several cases the main programs
crashes. In several cases it occurs when I simply close console window pressing “x”.
The question is: do you see any potential risks of using console window by the DLL, and should I close the console window when DLL functions finishes working ? May be you see an obvious breach of discipline of working with the console in such scheme ?