0

Hello,
I am trying to develop a program that will not show untill a boolian is set to false , but I am having trouble making the code work. Here is the code I am using to start the program;

#include "stdafx.h"
#include "Form1.h"

using namespace Program;

[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
	while(1==1)
	{
		if(screen = false)
		{
			Application::Run(gcnew Form1());
		}
		if(screen = true)
		{
			Application::Exit(Form1());
		}
	}
	return 0;
}

When I try and run this, I get the following error;

1>.\Program.cpp(24) : error C2665: 'System::Windows::Forms::Application::Exit' : none of the 2 overloads could convert all the argument types
1>        c:\windows\microsoft.net\framework\v2.0.50727\system.windows.forms.dll: could be 'void System::Windows::Forms::Application::Exit(System::ComponentModel::CancelEventArgs ^)'
1>        while trying to match the argument list '(Program::Form1)'

All of the variables have allready been defined in a different part of the program

Edited by MilesTailsProwe: n/a

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by jonsca
0

Change the first if statement to if(screen == false) or if(!screen) and for the second one if(screen == true) or if(screen) .

Edited by jonsca: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.