Console showing up with VC++ CLR GUI

I am trying to get a calculator program to work.
The following code is what's in my .cpp file.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Calculator.h"

using namespace System;
using namespace System::Windows::Forms;

[STAThread]
int main(){
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false);

	Calculator::Calculator form;
	Application::Run(%form);
}

How do I get only the window to come up and not the console with it?
Last edited on
closed account (13bSLyTq)
Hi,

It is because you have not told the CPU\PC to actually stop the window from closing.
If you want to show the console do this:
C langauge
1
2
3
4
5
6
7
8
#include<conio.h>
#include "Calculator.h"

int main()
{
_getch();
return 0;
}


C++ Language
1
2
3
4
5
6
7
8
#include<iostream>
#include "Calculator.h"

int main()
{
std::cin.get();
return 0;
}


Thanks!
That's not what I was asking.

How do I set up the program so that the console is not shown and the program is?
http://stackoverflow.com/questions/17275710/console-opens-when-running-gui-c-application

This is probably what you're looking for. Sounds like a project setting to me.
Topic archived. No new replies allowed.