I created a Windows Forms project according to this instruction, but as a result I get an error (see screenshot). Who has already encountered such a problem?

error screenshot

And here's the code that is written in MyForm.cpp

#include "MyForm.h" using namespace System; using namespace System::Windows::Forms; [STAThreadAttribute] void Main(array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Calculator::MyForm form; Application::Run(%form); } 

Closed due to the fact that off-topic participants 0xdb , aleksandr barakin , Enikeyschik , Jarvis_J , Denis Bubnov 5 Dec '18 at 12:40 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reasons:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - aleksandr barakin, Denis Bubnov
  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - 0xdb, Enikeyschik, Jarvis_J
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    Something tells me that Main should be written with a small letter :) - Harry
  • The documentation says that the arguments of the main function cannot be managed types. - VTT
  • And what about ^ ??? Is this a new C ++ standard ?? - vegorov
  • 2
    @vegorov I don’t know whether you are asking seriously or not, but this is C ++ / CLI, C ++ extension from Microsoft for programming under .NET (not only not new, but already pretty outdated). The question has already put the appropriate label. - MSDN.WhiteKnight
  • @ MSDN.WhiteKnight thanks. I will know now. - vegorov

1 answer 1

Main should be in small letters, thanks Harry

  • one
    @VladSpirin is an exhaustive answer to the question, not the edit and not the supplement - PashaPash ♦
  • 2
    @VladSpirin why? Writing Main with a small letter perfectly solves the problem from the question. If you do this by editing, then the question itself will lose its meaning, but it is not so obvious if you try to go to C ++ - cli with C # to go :) - PashaPash ♦
  • @PashaPash I agree, I hope not close, delete the comment. But there was a sediment that the answer should be painted a little bit - LFC