Author Topic: Console Application  (Read 5911 times)

Offline Shazey

  • Single posting newcomer
  • *
  • Posts: 5
Console Application
« on: March 11, 2012, 07:21:26 pm »
Is there a way to make a *.exe console application?
I tried running the application in bin/Debug but it just flashes and closes. I have no clue what to do :/

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Console Application
« Reply #1 on: March 11, 2012, 07:28:51 pm »
Project -> Properties -> Build targets -> Type == console
Project -> Properties -> Build targets -> Pause when the execution ends

Next time please read the manual.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Shazey

  • Single posting newcomer
  • *
  • Posts: 5
Re: Console Application
« Reply #2 on: March 11, 2012, 07:53:19 pm »
Did that before, still doesn't work.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Console Application
« Reply #3 on: March 11, 2012, 08:26:13 pm »
Did that before, still doesn't work.
If you run a console-application from (e.g.) windows explorer (I assume you are on windows), that does nothing but write some text on console (like the default hello-world example), you will see a console window flashing, long enough to display the text and close.
if you run it from commandline (cmd.exe in windows), you will see the output.
ALternatively you can run it through C::B and make sure the settings are like oBFusCATed has posted.

Offline Shazey

  • Single posting newcomer
  • *
  • Posts: 5
Re: Console Application
« Reply #4 on: March 11, 2012, 08:42:24 pm »
So, there is no other way than to run it through the Command Prompt?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Console Application
« Reply #5 on: March 11, 2012, 08:52:32 pm »
ALternatively you can run it through C::B and make sure the settings are like oBFusCATed has posted.

Another option is to put getch(); or while(1); at the end to see if there isn't some other error.
Like missing dll for example.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Shazey

  • Single posting newcomer
  • *
  • Posts: 5
Re: Console Application
« Reply #6 on: March 11, 2012, 09:10:48 pm »
Thanks for your help guys, I finally managed to make it work :)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Console Application
« Reply #7 on: March 11, 2012, 09:31:03 pm »
How, so it would be useful for the others having the same problem?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Shazey

  • Single posting newcomer
  • *
  • Posts: 5
Re: Console Application
« Reply #8 on: March 12, 2012, 09:22:58 pm »
I used the Command prompt way. What I did is I added the cmd.exe in the folder where my application is so it is easier ;) :D