Question about console windows
-
Hello all, I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows. When the user close the console window during the programming is running, my main GUI get closed at the same time too. What I think is that may be the console window process is a child process of the main GUI window, when the child prcoess get closed, its parent process will also be destoryed. However, the destcutor of my main GUI porcess didn't get called when the console get closed which cause a lot of memory leaks. Do anyone know why my main GUI window destructor did get called when one of it child process get closed? :)
-
Hello all, I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows. When the user close the console window during the programming is running, my main GUI get closed at the same time too. What I think is that may be the console window process is a child process of the main GUI window, when the child prcoess get closed, its parent process will also be destoryed. However, the destcutor of my main GUI porcess didn't get called when the console get closed which cause a lot of memory leaks. Do anyone know why my main GUI window destructor did get called when one of it child process get closed? :)
nachilau wrote:
I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows.
How are you doing that exactely ?
nachilau wrote:
when the child prcoess get closed, its parent process will also be destoryed
Certainly not. ~RaGE();
-
nachilau wrote:
I have written a program which contains a GUI windows and also a console windows. When the program start, I allocate a console window from Windows.
How are you doing that exactely ?
nachilau wrote:
when the child prcoess get closed, its parent process will also be destoryed
Certainly not. ~RaGE();
The way that I do it is AllocConsole(); m_hout = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleMode(m_hout, ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT); If you say that it is not true that when the child process get deleted, the parent process also get deleted, then I don't understand why my GUI get closed when the user close the console window.