When I create a windows form application in VC++.NET, the code below is autogenerated to launch Form1. I want 2 instance of Form1 to run concurrently. I added another Application::Run(new Form1());
. But, it didn't do what I wanted. After Form1 closes, the 2nd instance of Form1 is launched to run. What do I need to change to allow both to run concurrently? Thanks.
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
Application::Run(new Form1());
Application::Run(new Form1());
return 0;
}