views:

42

answers:

3

Is there a way to make the MFC app work both ways console as well as Window.

A: 

depends which mfc class are you using.! you can run MFC program both Console and Windows. However it totally depend upon what you going to program, which is not clear from your question.

I have programmed window application written in MFC to run both in Windows and console application, but that is project related requirement.

thatsalok
A: 

Yes, although it is slightly complicated. You would call AttachConsole(), instead of creating any windows, when you want to run as a console app.

MSalters
+1  A: 

No, this can't be done! There are way to achieve more or less the same result though. Here's the authoritative source: http://blogs.msdn.com/b/oldnewthing/archive/2009/01/01/9259142.aspx .

Roel