#5 vista crash / threading needs mainenance

open-fixed
nobody
None
5
2008-03-24
2008-02-09
Thomas
No

Hi fenix71, gzvP, pepsin!

When sending mail the program crashed under Windows Vista. I figurd out that it has something to do with the way Vista handles threads. You may not change certain gui elements directly from the thread any more. To make it work, I had to comment out some status notifications, e.g.:

private void SetBusy(bool isBusy)
{
mnuSendStart.Enabled = !isBusy;
//toolBarButtonStart.Enabled = !isBusy;
mnuSendPause.Enabled = isBusy;
mnuSendStop.Enabled = isBusy;
//toolBarButtonPause.Enabled = isBusy;
//toolBarButtonStop.Enabled = isBusy;
if(isBusy)
{
statusBarPanelStatus.Text = "Busy";
}
else
{
//statusBarPanelStatus.Text = "Idle";
}
m_busy = isBusy;
}

Or in SendViaSmtp:

//ShowItemCarrier(pAdr.Index, "SMTP:" + svr.HostID.ToString());

client.MaxSenderThreads = mySetting._maxThreads;
client.BeginSend(new string[] { to }, fromEmail, m.ConstructBinaryMime(), pAdr.Index.ToString());
//while (_cntActive >= mySetting._maxThreads+1)
{
Thread.Sleep(1000);
}

Just a crude hack to make it work. I'm sure you know what to do should you ever visit the projects bugtracker. :)

Discussion

  • Vincent Ma
    Vincent Ma
    2008-03-23

    • status: open --> open-accepted
     
  • Vincent Ma
    Vincent Ma
    2008-03-24

    Logged In: YES
    user_id=911684
    Originator: NO

    Good found!
    Try the new version.

    Thanks!

     
  • Vincent Ma
    Vincent Ma
    2008-03-24

    • status: open-accepted --> open-fixed