I have a quandary regarding C++ and .Net/WinForms. I have code written to launch a background worker to check user input against a web server. The code is as follows:
try {
loginworker->RunWorkerAsync();
}
catch(System::InvalidOperationException^) {}
Now, when I run the program and click the login button several times (thus triggering the 'Background worker is already running a task' error), I get an unhandled System::InvalidOperationException at that line of code. Is there something I'm missing here?
I've already written the code in a way that hides the login button until code execution completes on the background worker, but should it not catch the exception?
Collin