[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

converted code function

Posted on 2011-10-13
1
Medium Priority
?
216 Views
Last Modified: 2013-12-16
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

0
Comment
Question by:XK8ER
1 Comment
 
LVL 3

Accepted Solution

by:
KBerger earned 2000 total points
ID: 36964213
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

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

873 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