Click to See Complete Forum and Search --> : Window and AllocConsole
iWizardPro
July 28th, 2010, 06:46 PM
I am currently writing an application that opens a debug window during the runtime. With the application, then window would be opened using the command AllocConsole. The only issue is if the user closes the debug window, the entire application closes. Is there any way I can create a console that will not cause the Win32 API window to close?
Arjay
July 28th, 2010, 08:02 PM
Is there any way I can create a console that will not cause the Win32 API window to close?Not that I'm aware of.
ahmd
July 29th, 2010, 07:11 PM
Is there any way I can create a console that will not cause the Win32 API window to close?
You need to open it in a separate process. Use CreateProcess (http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx) for that.
Arjay
July 29th, 2010, 08:29 PM
You need to open it in a separate process. Use CreateProcess (http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx) for that.How would this work for what the OP is trying to do?
ahmd
July 30th, 2010, 12:47 AM
How would this work for what the OP is trying to do?
The OP writes the code that is output into the console window in a separate console project and starts it using CreateProcess. He/she may use Interprocess Communication or a simple command line parameters call to convey the information into this console application.
Arjay
July 30th, 2010, 03:24 PM
The OP writes the code that is output into the console window in a separate console project and starts it using CreateProcess. He/she may use Interprocess Communication or a simple command line parameters call to convey the information into this console application.Thanks for the clarification. The original response implied that CreateProcess could be used as a direct replacement for AllocConsole as opposed to having to create a separate application using interprocess communication.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.