Re: Why Does This Fail ( Threading )
Hi Larry,
I have implemented your solution in my code and it works. However, the way I
had to do this was to pass a reference of the form to the Class Invader and
Gun, this way I could do the Invoke of the method on the UI Thread in the
form.
Is this the way you would have done it ?
Thanks
--
OHM ( Terry Burns ) * Use the following to email me *
Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"Larry Serflaten" <serflaten@usin ternet.com> wrote in message
news:eNTqUWBuEH A.3788@TK2MSFTN GP09.phx.gbl...[color=blue]
>
> "Larry Serflaten" <serflaten@usin ternet.com> wrote
>[color=green]
>> Private Sub Form1_Closing(. ..)
>> e.Cancel = Done
>> Done = True
>> Application.DoE vents()
>> Th1.Abort()
>> Th2.Abort()
>> End Sub[/color]
>
>
> Should have been:
>
> e.Cancel = Not Done
>
> It was meant to cause the first hit on the close button to stop the
> threads (they take a while to close down) and the second hit to
> close the form....
>
> (Rather than add another button to stop the threads...)
>
> LFS[/color]
Hi Larry,
I have implemented your solution in my code and it works. However, the way I
had to do this was to pass a reference of the form to the Class Invader and
Gun, this way I could do the Invoke of the method on the UI Thread in the
form.
Is this the way you would have done it ?
Thanks
--
OHM ( Terry Burns ) * Use the following to email me *
Dim ch() As Char = "ufssz/cvsotAhsfbuTpmv ujpotXjui/OFU".ToCharArra y()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar( Convert.ToInt16 (ch(i)) - 1)
Next
Process.Start(" mailto:" & New String(ch))
--
"Larry Serflaten" <serflaten@usin ternet.com> wrote in message
news:eNTqUWBuEH A.3788@TK2MSFTN GP09.phx.gbl...[color=blue]
>
> "Larry Serflaten" <serflaten@usin ternet.com> wrote
>[color=green]
>> Private Sub Form1_Closing(. ..)
>> e.Cancel = Done
>> Done = True
>> Application.DoE vents()
>> Th1.Abort()
>> Th2.Abort()
>> End Sub[/color]
>
>
> Should have been:
>
> e.Cancel = Not Done
>
> It was meant to cause the first hit on the close button to stop the
> threads (they take a while to close down) and the second hit to
> close the form....
>
> (Rather than add another button to stop the threads...)
>
> LFS[/color]
Comment