Note, this is converted from C# with a converter program and some of my own hand coding, there is definitely a possibility that the compiler is right and something of the sort does not exist in C++, or its named diff.
I am having an issue with the long !System::Windows....line, getting the following compiling error:
1>UserFeedback.cpp(79): error C3083: 'Windows': the symbol to the left of a '::' must be a type
1>UserFeedback.cpp(79): error C3083: 'Forms': the symbol to the left of a '::' must be a type
1>UserFeedback.cpp(79): error C3083: 'Application': the symbol to the left of a '::' must be a type
1>UserFeedback.cpp(79): error C3083: 'ExecutablePath': the symbol to the left of a '::' must be a type
1>UserFeedback.cpp(79): error C2039: 'Equals' : is not a member of 'System'
internal:
static void Close()
{
// Assumption:
// If the console window title is equal to the executable path, exe was run by double
// If it doesn't (eg. prefixed by c:\windows\system32\cmd.exe - c:\Progra...... )
// it was run from a console window (or batch file!) and shouldn't wait for a key.
auto runningFromCommandPrompt = !System::Windows::Forms::Application::ExecutablePath::Equals(Console::Title, StringComparison::InvariantCultureIgnoreCase);
if (runningFromCommandPrompt)
return;
Info("Press any key to quit");
while (!Console::KeyAvailable)
{
System::Threading::Thread::Sleep(50);
}
}