Exception in the simples possible output statement

  • Thread starter Thread starter MyCatAlex
  • Start date Start date
M

MyCatAlex

Guest
int main(cli::array<System::String ^> ^args)
{

// Application::SetCompatibleTextRenderingDefault(false); // This line added
Application::EnableVisualStyles(); // This line added
Application::Run(gcnew Form1()); // This line added
std::cout << "\nHello World\n";
Console::WriteLine("Hello World");
return 0;
}

I have trouble with two lines here. The first line which is commented out fails at compilation. The message is that This statement needs to be executed before the first objects are created in the application (it is a form).

std:cout fails at run time. The exception says that for the second loop I should use ShowDialog instead. ShowDialog(); gives me the same exception: use ShowDialog.

Need help, - MyCatAlex

Continue reading...
 
Back
Top