converted code function

Posted on 2011-10-13
Last Modified: 2013-12-16
hello there,
I have converted this function from c# into 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

		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

Question by:XK8ER
    1 Comment
    LVL 3

    Accepted Solution


    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)

    Hope that helps, regards


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now