hey this is great. It was exactly what i needed. I played around w/ adding
a second thread to my program. I learned that is has to be a subroutine and
that you can't "pass parameters" you have to pull them from the thread,
which is fine, and i made a flag so i can check when its done, however, i'm
having trouble getting the parameters it saved. i have variables and a sub
in a class. I have an object in my program for hte class, and then another
object that is the subroutine from the class. the subroutine stores
variables within that class. i used to pull the variables, they were not
returns, however, now i can't get to these. here is the basic psuedo code
class1:
var1
var2
sub1()
do something with var1
store in var2
myobject = class1
thread = myobject.sub1
myobject.var1 = something
thread.start()
do something with myobject.var2
well, var1 and var2 are empty outside of the thread, but populated inside
the thread. i used this same approach w/o the thread, and i was able to see
my varibles. Is there some reason my thread isn't storing variables like
the sub did without the thread?
thanks for your help!
"Paul Bunting" <pa**********@archsoftnet.nospamplease> wrote in message
news:en**************@TK2MSFTNGP11.phx.gbl...
Something like...
IMPORTS System.Threading
Private Sub frmMe_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim objThread As New Thread(AddressOf fnThreadToRun)
objThread.IsBackground = True
objThread.Priority = ThreadPriority.Lowest
objThread.Name = "MyThread"
objThread.Start()
end sub
Private Sub fnThreadToRun()
'.... do something
End Sub
Regards,
P
"matt" <no****@nobody.com> wrote in message
news:r-******************************@comcast.com...i have a VB.net application that connects to the internet to download an
xml file and parse it. It works correctly, but "locks up" until that
function returns. i want to add asynchronous support, but i'm confused on
where i add the code. If i want just this function to be in another
thread, what do i add to it? Also, what do i add to call the function?
thanks,