0
Answer

how to use thread with parametrized function

Ask a question
Sandeep Dange

Sandeep Dange

14y
5.6k
1

hii, i want to use thread with a parameterized function.
 
 thread1 = New Thread(AddressOf mailTemplate)  
mailTemplate has following definition:
Public Function mailTemplate(ByVal tomail As String, ByVal subjectmail As String, ByVal body As String)
when i wrote the above declaration code of thread, i'm getting following error :

Error 7 Overload resolution failed because no accessible 'New' can be called with these arguments:
    'Public Sub New(start As System.Threading.ParameterizedThreadStart)': Method 'Public Function mailTemplate(tomail As String, subjectmail As String, body As String) As Object' does not have a signature compatible with delegate 'Delegate Sub ParameterizedThreadStart(obj As Object)'.
    'Public Sub New(start As System.Threading.ThreadStart)': Method 'Public Function mailTemplate(tomail As String, subjectmail As String, body As String) As Object' does not have a signature compatible with delegate 'Delegate Sub ThreadStart()'. E:\Project\Management\Management\ApplicationScreen.vb 1293 35 Management

state the solution if u know,