M
My name
Ok, this *should* have been easy, but I can't get this to work right.
What is happening in the following example is that in the myTest class, the
oThing is nothing after the first thread finishes Here is code sample:
Public Class myClass
private shared WithEvents myObject as myTest
Public Sub ThreadDone handles myObject.IDidIt ....
dim myObject as new myTest
Sub Main()
Dim i as int16 =0
Dim t(5) as thread
For each oThing in myThings
myObject.myThing = oThing
t(i)=new thread(AddressOf myObject.DoThing() )
i=i+1
Next
end sub
end class
Public Class myTest
Public Event IDidIt()
Public Property myThing() As oThing ...
Public Sub DoThing()
if _p.DoTheRealMagic() then
RaiseEvent IDidIt()
end sub
end class
---------------------
What is going wrong here?
TIA -
Larry
What is happening in the following example is that in the myTest class, the
oThing is nothing after the first thread finishes Here is code sample:
Public Class myClass
private shared WithEvents myObject as myTest
Public Sub ThreadDone handles myObject.IDidIt ....
dim myObject as new myTest
Sub Main()
Dim i as int16 =0
Dim t(5) as thread
For each oThing in myThings
myObject.myThing = oThing
t(i)=new thread(AddressOf myObject.DoThing() )
i=i+1
Next
end sub
end class
Public Class myTest
Public Event IDidIt()
Public Property myThing() As oThing ...
Public Sub DoThing()
if _p.DoTheRealMagic() then
RaiseEvent IDidIt()
end sub
end class
---------------------
What is going wrong here?
TIA -
Larry