Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C
I have code for a windows app with one form, Can I convert this to a console app using no forms? If so, yhen how?
Thanks
DS
Posted 24-Apr-11 6:01am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Of course you can. You would need to replace the UI with a console based UI. So any info you have on screen would have to be written to the console. And all forms of input would also come from the console. The core flow of the app may also change a bit because of the different input/output models between GUI and console apps.
 
There is no automatic conversion tool though as far as I know.
  Permalink  
v2
Comments
SAKryukov at 24-Apr-11 13:05pm
   
Fair enough, my 5.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Just try google for this
convert a Windows App to a Console App[^]
  Permalink  
Comments
Member 7766180 at 24-Apr-11 11:58am
   
Will look around, it seems that it can be done but not too easy, Fortunately I only have one form.
Thanks
DS
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

You can change the project settings to create a Console Application instead of a Windows Application (just hit Ctrl+Enter on the project in the Solution Window, and make that change).
 
That will compile the application as a Console Application, and you'll get a console. However, you'll still get your forms. If you want to not have Windows Forms, you'll need to remove the forms, and replace their functionality with command line arguments or configuration. You can then remove the Windows Forms references, and it'll be converted.
I've copied it from
http://stackoverflow.com/a/3427089[here] answered by Reed Copsey
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 200
1 George Jonsson 175
2 Kornfeld Eliyahu Peter 169
3 PIEBALDconsult 110
4 Richard MacCutchan 85
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 12 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100