|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VB Threading issuesHi All:
Im new to the threading programming, and i have problem working with threads in my VB.NET application. I have a module.vb with the following thread definition in the declarations: Public Thread_Test As New System.Threading.Thread(AddressOf MDIChild.SomeFunction) The problem resides after the thread had been terminated, how can i start a new thread for the same function ?, also the fuction should be able to call Thread_Test.start(); Thread_Test.Suspend() and Thread_Test.resume() from any function in the program. Any idea ? Thanks, Federico
Show quote
Hide quote
"Federico G. Babelis" <feder***@gazum.com> wrote in I may be wrong here, but if Thread_Test is defined at the *module* level news:#GiBao$MFHA.2468@tk2msftngp13.phx.gbl: > Hi All: > > Im new to the threading programming, and i have problem working with > threads in my VB.NET application. I have a module.vb with the > following thread definition in the declarations: > > Public Thread_Test As New System.Threading.Thread(AddressOf > MDIChild.SomeFunction) > > The problem resides after the thread had been terminated, how can i > start a new thread for the same function ?, also the fuction should be > able to call Thread_Test.start(); Thread_Test.Suspend() and > Thread_Test.resume() from any function in the program. > > Any idea ? > > Thanks, > Federico > > > then you should just be able to call Thread_Test.Start anytime any where inside that module. If it's out side the module *I THINK* Thread_Test needs to be declared as "Public Shared Thread_Test As New System.Threading.Thread(AddressOf MDIChild.SomeFunction)" and referenced as Module1.Thread_Test.Start() Also I believe the SomeFunction should be SomeSub (can't use functions) as well, and that Sub will also have to be declared as "Shared" then you should be good to go. MP
SqlDateTime.MinValue, SqlDateTime.MaxValue: WATCH OUT!
IO function in Vb.Net slower than in Vb6.0 OT : Are you guys in the US on a Public Holiday today ? New Problem with timers ComboBox needs help CurrencyManager Question Dataset problem My Threading Timer Doesn't Fire Unshare an Excel sheet with VB.Net New to .NET ... I have a few questions |
|||||||||||||||||||||||