R
Ron Weiner
I would like to start a print job running on its own thread in order to give
control back to the user as soon as possible. I have created a sub
PrintOneRecord(intRecordID) that does the deed. I thought I could start the
print job running on its own thread by coding something like this:
Dim MyThread As New System.Threading.Thread(AddressOf
PrintOneRecord(intRecordID))
MyThread.Priority = Threading.ThreadPriority.BelowNormal
MyThread.Start()
But this give an error in the editor "AddressOf operator must be the name of
a method; no parentheses are needed"
Changing it to:
Dim MyThread As New System.Threading.Thread(AddressOf PrintOneRecord)
MyThread.Priority = Threading.ThreadPriority.BelowNormal
MyThread.Start()
Gives an even better error message "Method 'Public Sub
PrintOneRecord(intDatID as Integer)' does not have the same signature as
delegate 'Delegate Sub Thread start'."
Can some one help me sort this out. All I want to do is to start a new
thread running the Sub PrintOneRecord and pass it the RecordID that needs to
get printed.
control back to the user as soon as possible. I have created a sub
PrintOneRecord(intRecordID) that does the deed. I thought I could start the
print job running on its own thread by coding something like this:
Dim MyThread As New System.Threading.Thread(AddressOf
PrintOneRecord(intRecordID))
MyThread.Priority = Threading.ThreadPriority.BelowNormal
MyThread.Start()
But this give an error in the editor "AddressOf operator must be the name of
a method; no parentheses are needed"
Changing it to:
Dim MyThread As New System.Threading.Thread(AddressOf PrintOneRecord)
MyThread.Priority = Threading.ThreadPriority.BelowNormal
MyThread.Start()
Gives an even better error message "Method 'Public Sub
PrintOneRecord(intDatID as Integer)' does not have the same signature as
delegate 'Delegate Sub Thread start'."
Can some one help me sort this out. All I want to do is to start a new
thread running the Sub PrintOneRecord and pass it the RecordID that needs to
get printed.