Click here to Skip to main content
16,020,701 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!
How Can I Create a new thread and pass parameters to it?

This is an example without passing parameters:
Private Sub MySub(ByVal i as integer, ByVal j as integer)
  Console.Writeline (i+j)
End Sub

Private Sub MySubCaller()
  Dim T As New Thread(AddressOf MySub,1024*1024) 'second parameter is stack size
  T.Start()
End Sub


So How Can I call MySub() using Thread With Passing parameters to it?
Posted

1 solution

By using parameterized thread.

See here for some more explenation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900