converted code function

hello there,
I have converted this function from c# into vb.net but for some reason I get an error on the "new Thread"
saying "Error      1      Syntax error."
how can I get it right?


        public void Decode(DecodeDelegate callback, byte[] img, int timeout)
        {
            DecodePayload payload = new DecodePayload();
            payload.Callback = callback;
            payload.Image = img;
            payload.Timeout = timeout;
            new Thread(DecodeWithCallback).Start(payload);
        }

Open in new window

into
		Public Sub Decode(callback As DecodeDelegate, img As Byte(), timeout As Integer)
			Dim payload As New DecodePayload()
			payload.Callback = callback
			payload.Image = img
			payload.Timeout = timeout
			New Thread(AddressOf DecodeWithCallback).Start(payload)
		End Sub

Open in new window

LVL 1
XK8ERAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KBergerCommented:
Hi,

I am Not too good in vb, but anyway...i guess vb does not Support this Syntax. You might try to put parenthesis before "New" and before the dot.
But I think the correct style in vb would be this:
Dim Thread As Thread = New Thread(AddressOf DecodeWithCallback)
Thread.Start(payload)

Hope that helps, regards

-kristof
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.