i have a function that contains the following
WebUpdateThread = New System.Threading.Thread(AddressOf generatecids)
WebUpdateThread.SetApartmentState(ApartmentState.STA)
WebUpdateThread.Start()
'after starting the thread i have some code that i want to run when the thread finshes its work which takes about 3-4 hours
'if i put for example
MsgBox("something")
the message box shows as soon as the thread starts, how do i make it wait until the thread is finshed?
is there something more sufficient than an infitine while loop that checks the thread state?