Basic commands not working in the main file

So, I've created a windows form application. This means that besides my form.h, I still have the project.cpp, which contains:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "stdafx.h"
#include "Form1.h"
using namespace Calculator;

[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
	// Enabling Windows XP visual effects before any controls are created
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false);
	// Create the main window and run it
	Application::Run(gcnew Form1());
	return 0;
}

I can't get this first console to display anything. As far as I understand, this code is ran before the form being started up, I inserted a system("PAUSE") and I got a console with PRESS ANY KEY TO CONTINUE, after pressing a key or closing that console, the form ran.
Now, I tried using basic commands such as cout, printf, but none is showing before the system("PAUSE"); (Of course, I included iostream, tried both cout<<"Something"<<endl; and std::cout<<"Something"<<endl;, printf("message");, etc, nothing is working)
Working in Visual C++ 2010 Express
Any help is appreciated
Thank you in advance!
Ok, so I think it would be best for you to lay off Visual Studio for a bit. It seems that you confuse project types and it would just be easier if you moved to a different IDE just to get you started on C++.

What you have there is a C++/CLI Windows Forms project that uses the .Net framework. It is also NOT a console program, meaning it doesn't have a console, meaning it doesn't use cout and all the commands you are looking for. This project's intention is to generate a GUI application.

So you can either move to a pure-C++ IDE or study the choices of project types in Visual Studio. Since there aren't just a few, I refuse to talk about them here. Google them up if you like.

If you don't really care about all Visual Studio options, I can tell you that you need to select the Win32 Project option for C++. Once you do you are presented with a wizard. In here you can choose to create a DLL, a console, a GUI application or a static library. Choose console. Also choose empty project and make sure you don't select MFC or ATL.

This gives you an empty project. Add a CPP file and write your main() in there.
Oh, I used to work in console C++ for a pretty long time, then I decided to move to Visual, and Windows Form Application just caught my attention...When I saw the CPP file and the actual system("PAUSE");, etc working, I thought that the program just creates a console window which then runs the form :D
Thank you for your information! That for sure cleared some doubts :D
Topic archived. No new replies allowed.