none
Thread does not have a signature compatible with delegate RRS feed

  • Question

  • Hi,

    Here's how I start a Thread:

        ...
        Dim Threads As New Thread(New ParameterizedThreadStart(AddressOf MyThread))
        Threads.Start()
    End Sub
    Private Sub MyThread()
        ...

    I get the following error ONLY if I Enable Option Strict:

    Method 'Private Sub MyThread()' does not have a signature compatible with delegate 'Delegate Sub ParameterizedThreadStart(obj As Object)'.

    Please advise how to eliminate this error?

    Thanks for the help.


    Sunday, February 17, 2019 2:47 AM

Answers

  • Use the following

    Private Sub MyThread(obj As Object)
    
    End Sub


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by OSVBNET Sunday, February 17, 2019 8:13 AM
    Sunday, February 17, 2019 5:26 AM
    Moderator

All replies

  • Use the following

    Private Sub MyThread(obj As Object)
    
    End Sub


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Marked as answer by OSVBNET Sunday, February 17, 2019 8:13 AM
    Sunday, February 17, 2019 5:26 AM
    Moderator
  • Thanks indeed :)
    Sunday, February 17, 2019 8:12 AM