//this function runs on the background thread private void bw_DoWork(object sender, DoWorkEventArgs e) { try { CalibrateWV.CalibrateImage((WVConversionSettings)e.Argument); } catch (Exception ex) { conversionErrorMessage = "Error! " + ex.Message; //some error occurred during conversion, so store message to report } }
//this function runs on the background thread private static void bw_DoWork(object sender, DoWorkEventArgs e) { try { CalibrateWV.CalibrateImage((WVConversionSettings)e.Argument); Console.WriteLine(); } catch (Exception ex) { //error occurred, so report it Console.WriteLine("\nError! " + ex.Message); } }