1

I am thinking to replace the edit box in my GUI with console itself. How can I integrate console in the GUI application, which currently lingers as independent window. And I need to develop in native c++ (MFC). No to CLR (dot net etc).

PS: actually I need to develop a GUI application that starts a lengthy background process and give its concurrent display on GUI's edit box. Since my previous question largely remained unanswered, I thought of this plan

MFC: Display output of a process asynchronously(concurrently) while process is in execution in a win32 text area (mfc application)

Community
  • 1
  • 1
Konark
  • 31
  • 2
  • While embedding the Windows console will be hard (if not impossible), getting the output from the console program shouldn't be impossible. See for example http://stackoverflow.com/questions/191842/how-do-i-get-console-output-in-c-with-a-windows-program for some tips, or http://stackoverflow.com/questions/450865/what-is-the-equivalent-to-posix-popen-in-the-win32-api for other tips. – Some programmer dude Mar 05 '12 at 13:24
  • Why do you need a console? you only want to output text ? do you need to be able to input DOS commands ? It is not clear what the requirements are. – Max Mar 05 '12 at 13:47
  • @JoachimPileborg thanks, u guessed it right "embedding windows console". – Konark Mar 06 '12 at 07:29
  • @Max I need to output real time text of a console process on GUI. I couldn't find a way for it, therefore thought of embedding the console itself. – Konark Mar 06 '12 at 07:29

1 Answers1

1

I'm not sure if I totally understand the question. Here is something that might help you: If you want a GUI app starting with a console window, then add following info to your linking command line (ansi):

/entry:"WinMainCRTStartup" /subsystem:console

or (unicode)

/entry:"wWinMainCRTStartup" /subsystem:console

Payton Wu
  • 69
  • 2