Click here to Skip to main content
15,921,548 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: sending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
Rajesh Anuhya12-Apr-10 2:14
professionalRajesh Anuhya12-Apr-10 2:14 
AnswerRe: sending bytes from a pc to another using udp in vbwinsock (vb 2008) Pin
Michel Godfroid14-Apr-10 12:22
Michel Godfroid14-Apr-10 12:22 
QuestionDataReader.Read not working? [Solved] Pin
B-rad A7-Apr-10 11:15
B-rad A7-Apr-10 11:15 
AnswerRe: DataReader.Read not working? Pin
Pete O'Hanlon7-Apr-10 11:49
mvePete O'Hanlon7-Apr-10 11:49 
AnswerRe: DataReader.Read not working? Pin
jaypatel51211-Apr-10 1:56
jaypatel51211-Apr-10 1:56 
Questionthreading: always call delegate.EndInvoke? Pin
Mr.PoorEnglish7-Apr-10 10:30
Mr.PoorEnglish7-Apr-10 10:30 
AnswerRe: threading: always call delegate.EndInvoke? Pin
Alan N8-Apr-10 3:55
Alan N8-Apr-10 3:55 
GeneralRe: threading: always call delegate.EndInvoke? Pin
Mr.PoorEnglish10-Apr-10 4:33
Mr.PoorEnglish10-Apr-10 4:33 
Thank you very much! Especially
Alan N wrote:
...but I thought your post was looking lonely! ...

shows a noble character, and i'm happy to see, such magnanimity still exists in the real world Smile | :) .

Finally i found an answer, and a reasonable reason to call Action<whatever>.EndInvoke():
Exceptions of the sideThread are saved to the calling thread (May be you knew that already, to me it's new).
In Designmode there is no difference - the Debugger stops where the exception is thrown.
But in Release-mode it's important, and very dangerous, because a lost exception leaves the program running in an instable State!
C#
using System.Windows.Forms;
using System;
using System.Threading;

namespace AsyncWorkerCs {
   public partial class frmMain : Form {

      [STAThread]
      static void Main() {
         Application.EnableVisualStyles();
         Application.Run(new frmMain());
      }

      public frmMain() {
         InitializeComponent();
         btCreateError.Click += btCreateError_Click;
      }

      void btCreateError_Click(object sender, EventArgs e) {
         var createError = new Action(CreateError);

         // in Release-mode this will crash the app (recommended behavior if an unhandled exception occurs).
         //createError.BeginInvoke(createError.EndInvoke, null);

         // in Release-mode this will cause no Exception, but leave the app running in an undefined state!
         createError.BeginInvoke(null, null);          
      }

      void CreateError() {
         Thread.Sleep(500);
         throw new Exception("CreateError()!");    // in Debug-mode IDE always will stop here
      }
   }
}

Hmm, now i've found a reason to call Action.EndInvoke, it's one more reason to deprecate the Backgroundworker-class, isn't it?
a very strong reason to deprecate it, since the dangerous behavior does not occur in Debug-mode.
So it causes its surprises really late.

regards
QuestionHow to pass value from Datagrid column to floating div column Pin
GladysRajan7-Apr-10 9:25
GladysRajan7-Apr-10 9:25 
QuestionExplorer Integration Pin
Jaymie7-Apr-10 2:42
Jaymie7-Apr-10 2:42 
AnswerRe: Explorer Integration Pin
Dave Kreskowiak7-Apr-10 4:51
mveDave Kreskowiak7-Apr-10 4:51 
Questionvb.net graphics, hue overlay? Pin
lilx2k6-Apr-10 20:50
lilx2k6-Apr-10 20:50 
AnswerRe: vb.net graphics, hue overlay? Pin
Dave Kreskowiak7-Apr-10 4:33
mveDave Kreskowiak7-Apr-10 4:33 
QuestionHelp needed saving an XML document from a VC++ 2008 .NET app Pin
Ger Hayden6-Apr-10 6:19
Ger Hayden6-Apr-10 6:19 
AnswerRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Not Active6-Apr-10 8:46
mentorNot Active6-Apr-10 8:46 
AnswerRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Estys7-Apr-10 1:25
Estys7-Apr-10 1:25 
GeneralRe: Help needed saving an XML document from a VC++ 2008 .NET app Pin
Ger Hayden7-Apr-10 23:24
Ger Hayden7-Apr-10 23:24 
QuestionSave Listview by Groups Pin
CeremBeyazit5-Apr-10 7:18
CeremBeyazit5-Apr-10 7:18 
QuestionGDI+ Architect Alternative? Pin
Som Shekhar3-Apr-10 8:36
Som Shekhar3-Apr-10 8:36 
Questionhow to programmatically get a list of resource file names in solution explorer [modified] Pin
fjparisIII2-Apr-10 23:46
fjparisIII2-Apr-10 23:46 
AnswerRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 10:21
Alan N3-Apr-10 10:21 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
fjparisIII3-Apr-10 10:46
fjparisIII3-Apr-10 10:46 
GeneralRe: how to programmatically get a list of resource file names in solution explorer Pin
Alan N3-Apr-10 13:32
Alan N3-Apr-10 13:32 
GeneralYour code works (SOLVED) Pin
fjparisIII4-Apr-10 14:36
fjparisIII4-Apr-10 14:36 
AnswerRe: how to programmatically get a list of resource file names in solution explorer Pin
Luc Pattyn3-Apr-10 10:35
sitebuilderLuc Pattyn3-Apr-10 10:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.