|
this is the sample code from which i tried.its from a codeproject article
now tell me the way in which i can use parameterizedthreadstart
there param12 is object of parameterizedthreadstart
ParameterizedThreadStart pts = new ParameterizedThreadStart(MyParameterizedMethod);
Thread t = new Thread(pts);
double d = 123d;
ArrayList al = new ArrayList();
al.Add("Hei");
al.Add(2);
t.Start(al);
WaitCallback myCallback = new WaitCallback(MyParameterizedMethod);
if (!ThreadPool.QueueUserWorkItem(myCallback, al))
{
throw new Exception("Not able to queue work item");
}
private void MyParameterizedMethod(Object o)
{
ArrayList al = (ArrayList) o;
String param1 = (String) al[0];
int param2 = (int)al[1];
}
with regards
Balagurunathan.B
|
|
|
|
|
Cute and all, but this isn't YOUR code. This is the code you're trying to make work.
I want to see YOUR code.
|
|
|
|
|
yeah true. i never said u thats my code
i have already posted the code now again i am pasting the code
Dim param12 As New ParameterizedThreadStart(AddressOf paeamthread)
Dim arr1(3) As String
arr1(0) = "trial"
arr1(1) = "parameter"
arr1(2) = "passing"
Dim tt As New Thread(AddressOf param12)
tt.Start(arr1)
then why its saying method should be without parameter in thread . its obvious for normal thread i am trying to do parameterizedthreadstart
thanks
with regards
Balagurunathan.B
|
|
|
|
|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim newThread As New Thread(AddressOf worker)
Dim arrParameters(2) As String
arrParameters(0) = "This "
arrParameters(1) = "is "
arrParameters(2) = "a test!"
newThread.Start(arrParameters)
End Sub
Private Sub worker(ByVal param As Object)
Dim params() As String = DirectCast(param, String())
For Each s As String In params
Debug.WriteLine(s)
Next
End Sub
In order to use this, you have to be using .NET 2.0 and VB.NET 2005.
|
|
|
|
|
In web development the Cancel button would always be set to Causes Validation = False so how can I reproduce that in a Windows App where I might be in the middle of entering data but decide to close the form using the X button and I need to be able to close it without it validating and this looks like the only way for me to check the values of the databound textboxes without it getting to the Null entry on an Integer column and throwing an exception.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
Try handling the Form's Closing event and turning off it's CausesValidation property.
|
|
|
|
|
Dave Kreskowiak wrote: Try handling the Form's Closing event and turning off it's CausesValidation property.
Wow, duh on my part. I have MDI forms and I was thinking that if I turned the "CausesValidation" off on the parent form it would work since that is where the "X" is...oh well. Thanks!
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
|
|
|
|
|
But the FormClosing event happens *after* the Validating events of the controls on the Form, because they are triggered by the loss of focus.
I hope you realise that hamsters are very creative when it comes to revenge. - Elaine
|
|
|
|
|
hi
this is sanapathi
i have three text boxes in my .aspx page like title,datesbetween.
now i want to get the data from sqlserver database.in the database under videos table i have the fields like title,dateentered,videoid.how can i retrieve data from the data base.
|
|
|
|
|
I have an updatepanel with a little animation in it and I want to trigger this when the user clicks the button in the loign control.
But everytime I add a trigger of LoginControl - OnLoggingIn it throws this error the first time the site is run (after a service start or a long period)
Sys.WebForms.PageRequestManagerParserErrorException: The message recived from the server could not be parsed. Common causes for this error are the response is modified by calls to Response.Write(), reponse filters, HttpModules, or server trace is enabled.<br />
Details: Error parsing near '_WS/SE/Welcome.aspx|<html><br />
<head><br />
'.
Anyone know why this is? Or how to help?
|
|
|
|
|
This is a question better asked in the ASP.NET forum.
|
|
|
|
|
okay I will post it on there.
Feel free to remove this one.
|
|
|
|
|
hello frnds,
i can protect a word file and allow only comments to enter, by programatically
oDoc.protect(wdAllowOnlyComments,"Password")
can i protect the excel file ????
if any one have code then please give ???
same like word file i have to allow only comments in the file
thankx to all
-koolprasad2003
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Since you seem to have a mountain of questions regarding the object models of Word and Excel, you might want to start reading here[^].
|
|
|
|
|
Thankx a lot
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
Hi guys.
I wanna declare a sub like this:
Private Sub Test( byval val1 as integer, Optional byval val2 as system.object = Me)<br />
but it handle an error like this: Constant expression is required.
i think this error is generated by Me . How i can declare my optional val2 with a form like Me?
|
|
|
|
|
Try passing it byref instead.
Ben
|
|
|
|
|
if u r providing the form name in the last parameter . then u can assign nothing to it as well in the definition part.
|
|
|
|
|
Me cannot be used here. It's an abstract concept that refers to the current instance of the class that it shows up in. You have to replace it with something like this:
Private Sub Test(ByVal vl1 As Integer, Optional ByVal val2 As Object = Nothing)
If val2 Is Nothing Then
val2 = Me
End If
|
|
|
|
|
|
can i use the exit code in the deployment project?
|
|
|
|
|
|
well.. i guess nilish is talking abt the Exitcode which tells the installer abt the suucessful completion of an Exe which the installer fires during its execution. Exitcode-1 shows that application hasn't cpmpleted successfully.. whereas Exitcode-0 shows successful completion of the application.. upon getting which the installer proceeds further!
|
|
|
|
|
desperate_coder wrote: i guess nilish is talking abt the Exitcode which tells the installer abt the suucessful completion of an Exe which the installer fires during its execution.
Is it? or is it the exit code of the installer itself? There's a few different places it an exit code could come from. It's up to him to explain what he's talking about. I've long since given up wasting my time assuming such things.
desperate_coder wrote: Exitcode-1 shows that application hasn't cpmpleted successfully.. whereas Exitcode-0 shows successful completion of the application..
There is a "standard" to be followed here, but not every EXE follows it.
|
|
|
|
|
hi
i want to know to do thread with parameter using vb.net .
pls guide me with some examples and articles
with regards
Balagurunathan.B
|
|
|
|