|
I'm not able to solve the second error (Method 'Public Shared Sub MyThreadExecute(Origin As Object)' does not have a signature compatible with delegate 'Delegate Sub ThreadStart()').
When I create the thread with the instruction:
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
I can't add any other parameter, or I don't know how.
Searching the help I found that the delegate ThreadStart() is called automatically when I call "New Thread(AddressOf ...)" so how can I modify its parameters?
I really don't know what to do...
|
|
|
|
|
Can you post the code in it's current state?
Guess it'll work if you remove the "origin" parameter that I added there
steve_9496613 wrote: Searching the help I found that the delegate ThreadStart() is called automatically when I call "New Thread(AddressOf ...)" so how can I modify its parameters?
One can pass in an object when the thread is started;
MyNewThread.Start(Me) At that point, "Me" would be the form. The start-method then executes the MyThreadExecute-method, where we have to cast it back to it's original type.
|
|
|
|
|
Here is the code (the code is in two files: one for Form1 and one for MyThread):
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyNewThread.Start()
End Sub
Public Sub AggiornaLabel(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf AggiornaLabel), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute(ByVal Origin As Object)
Dim OriginForm As Form1 = CType(Origin, Form1)
Do
iii = iii + 1
OriginForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Class
if I remove the "origin" parameter as in the commented lines in the code above the error disappears and I can run the application on the device but the label is not updated because the condition "If InvokeRequired Then" is alwais false (as it was in the first example I posted).
Perhaps I have not removed the "origin" parameter in a consistent manner (I have more then one doubt about the line "Dim OriginForm As Form1 = New Form1()"...)
About passing a parameter in an object when I start the thread, I can't do this because in the Compact Framework (not the full .NET) only the method Thread.Start() is supported, the method Thread.Start(Object) is not supported.
Perhaps this is another reason why the code doesnt work: the MyThreadExecute-method has no "connection" with Form1 and so in Form1 InvokeRequired is false.
ps: I thank you for your patience...
|
|
|
|
|
steve_9496613 wrote: About passing a parameter in an object when I start the thread, I can't do this because in the Compact Framework (not the full .NET) only the method Thread.Start() is supported, the method Thread.Start(Object) is not supported.
Aw, darn. Without that, it's not possible to pass the form as an argument.
Since AggiornaLabel is a method of the form (as should be), you'd need to have a reference to the form in order to invoke it. An ugly bypass would be to use a "shared" member, aka a static method. Works similar to the shared integer called 'iii'.
Imports System.Threading
Public Class Form1
Dim MyNewThread As Thread
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MyNewThread = New Thread(AddressOf MyThread.MyThreadExecute)
MyNewThread.Name = "NuovoThread"
MyThread.ThatForm = Me
MyNewThread.Start()
End Sub
Public Sub AggiornaLabel(ByVal What As String)
If InvokeRequired Then
Invoke(New Action(Of String)(AddressOf AggiornaLabel), New Object() {What})
Return
End If
Label1.Text = What
End Sub
End Class
Public Class MyThread
Private Shared miii As Int32 = 0
Public Shared ThatForm As Form1
Public Shared Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Shared Sub MyThreadExecute()
Do
iii = iii + 1
ThatForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Class That's abusing things a bit; a class that's never instantiated would be a module, eliminating the need to declare each member being 'shared';
Module MyThread
Private miii As Int32 = 0
Public ThatForm As Form1
Public Property iii() As Int32
Get
Return miii
End Get
Set(ByVal value As Int32)
miii = value
End Set
End Property
Public Sub MyThreadExecute()
Do
iii = iii + 1
ThatForm.AggiornaLabel(iii.ToString)
Thread.Sleep(100)
Loop
End Sub
End Module
|
|
|
|
|
Yessss! It works!
Both with the class than with the module.
In my project I have used a class but, if it is a cleaner way, I can still use a module, the project is not so advanced so the changes will not be too painful.
Thank you very much Eddy, your help has been precious!
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi friends,
Now I want to bind gridview from webservice using jquery,ajax or javascript..
How can i achive that..
|
|
|
|
|
The solution to your problem comes in three steps
1. Write [WebMethod] (service) to return data from the datatable. But before returning it to your ajax method call convert it to an array. This is because javascript does not understand things such as datatable,dataset,datarow etc...
2. In your aspx page header write an ajax call which should look something like this:-
$(document).ready(function() {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default.aspx/BindDatatable",
data: "{}",
dataType: "json",
success: function(data) {
for (var i = 0; i < data.d.length; i++) {
$("#gvDetails").append("<tr><td>" + data.d[i].UserId + "</td><td>" + data.d[i].UserName + "</td><td>" + data.d[i].Location + "</td></tr>");
}
},
error: function(result) {
alert("Error");
}
});
});
inside the script tags. UserName,UserId,Location are column names from the database.
3. Bind a dummy datatable to your gridview. It should look something like this:
private void BindColumnToGridview()
{
DataTable dt = new DataTable();
dt.Columns.Add("UserId");
dt.Columns.Add("UserName");
dt.Columns.Add("Location");
dt.Rows.Add();
gvDetails.DataSource = dt;
gvDetails.DataBind();
gvDetails.Rows[0].Visible = false;
}
this is done so that correct data is mapped to the correct columns in gridview.
All the best.
|
|
|
|
|
Hello
Do you know of any example for Nlog for .Net compact 3.5?
Any help how to start working with Nlog for .Net compact?
Thanks!
|
|
|
|
|
TalSt wrote: Do you know of any example for Nlog for .Net compact 3.5? Try here[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks, but I need specific information
|
|
|
|
|
Then you need to post a specific question; we cannot guess what your problem may be.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I am looking for logging code for .Net compact, for example writing to log file, msgbox amd so.
thanks!
|
|
|
|
|
Did you try a Google search[^]?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
TalSt wrote: Do you know of any example for Nlog for .Net compact 3.5?
You know that NLog source code is available right?
So if you do not find the current binary workable, get the source and modify it as you see fit.
|
|
|
|
|
Hi,
I finally wrote a wrapper for NLog .net compact... (2 years ago).
It seems to work very well after so long time
|
|
|
|
|
Keywords
• Final year projects.
• Projects for Final year students.
• MCA Final year project Titles.
• MCA Final year project PPT.
• MCA Final year project Report.
• MCA Final year project ASP.NET.
• MCA Final year project Topics.
• MCA Final year project in companies.
• MCA Final year project in Bangalore.
• BCA Final year projects in Bangalore.
• Diploma Final year projects in Computer science.
• Diploma Final year projects.
• Diploma in final year projects in Bangalore.
• IEEE projects for computer science.
• IEEE projects list
• IEEE projects for ECE.
• IEEE projects on networking.
• IEEE project Titles.
• IEEE projects 2013.
• IEEE projects in Java.
• IEEE projects for J2ee.
• IEEE projects in Java 2011.
• IEEE projects in Java at Bangalore.
• IEEE projects in Bangalore.
• Live projects in Bangalore.
• Networking projects in Bangalore.
• projects for final year students.
• Final year projects for computer science in bangalore.
• Final year projects in JAVA at bangalore.
• Final year projects to pic bangalore.
• Final year projects 2013 or free projects.
• Final year projects in IT.
• B.Tech final year projects for cse JAVA.
• MCA projects.
• MCA final year projects in JAVA.
• Mca final year projects in PHP.
Content
Are you looking for a IEEE projects in Bangalore????We are there to help you....Projects in all the Streams such as BE/B.Tech,ME/M.Tech,Arts & Science.....
Dear students we offer final year IEEE projects in the following domain in Domlur
ABOUT DOMAIN at CEGONSOFT Pvt LTD
1. IEEE Projects
2. Web Based Application
3. Windows Based Application
4. Networking Application
ABOUT PROJECT TECHNOLOGIES at CEGONSOFT Pvt LTD
1. JAVA
2. J2EE
3. DOT NET
4. VB. NET
5. ASP.NET
6. ASP.NET + C#
7. VB.NET + C#
8. ASP.NET + VB
9. C# .NET
10. PHP/MYSQL
Projects for Final year students.
MCA Final year project ASP.NET.
MCA Final year project Topics.
MCA Final year project in companies.
MCA Final year project in Bangalore.
BCA Final year projects in Bangalore.
Diploma Final year projects in Computer science.
Diploma Final year projects.
Diploma in final year projects in Bangalore.
IEEE projects on networking.
IEEE project Titles.
IEEE projects 2013.
For more details
contact or walkin to
Aruna Devi T
7483065765
Cegonsoft Pvt.Ltd
#270,Sancia House,14th cross
Domulur Layout,
Bangalore-71.
www.cegonsoft.com/dotnet.php[]
|
|
|
|
|
Keywords
• Final year projects.
• Projects for Final year students.
• MCA Final year project Titles.
• MCA Final year project PPT.
• MCA Final year project Report.
• MCA Final year project ASP.NET.
• MCA Final year project Topics.
• MCA Final year project in companies.
• MCA Final year project in Bangalore.
• BCA Final year projects in Bangalore.
• Diploma Final year projects in Computer science.
• Diploma Final year projects.
• Diploma in final year projects in Bangalore.
• IEEE projects for computer science.
• IEEE projects list
• IEEE projects for ECE.
• IEEE projects on networking.
• IEEE project Titles.
• IEEE projects 2013.
• IEEE projects in Java.
• IEEE projects for J2ee.
• IEEE projects in Java 2011.
• IEEE projects in Java at Bangalore.
• IEEE projects in Bangalore.
• Live projects in Bangalore.
• Networking projects in Bangalore.
• projects for final year students.
• Final year projects for computer science in bangalore.
• Final year projects in JAVA at bangalore.
• Final year projects to pic bangalore.
• Final year projects 2013 or free projects.
• Final year projects in IT.
• B.Tech final year projects for cse JAVA.
• MCA projects.
• MCA final year projects in JAVA.
• Mca final year projects in PHP.
Content
Are you looking for a IEEE projects in Bangalore????We are there to help you....Projects in all the Streams such as BE/B.Tech,ME/M.Tech,Arts & Science.....
Dear students we offer final year IEEE projects in the following domain in Domlur
ABOUT DOMAIN at CEGONSOFT Pvt LTD
1. IEEE Projects
2. Web Based Application
3. Windows Based Application
4. Networking Application
ABOUT PROJECT TECHNOLOGIES at CEGONSOFT Pvt LTD
1. JAVA
2. J2EE
3. DOT NET
4. VB. NET
5. ASP.NET
6. ASP.NET + C#
7. VB.NET + C#
8. ASP.NET + VB
9. C# .NET
10. PHP/MYSQL
Projects for Final year students.
MCA Final year project Titles.
MCA Final year project PPT.
MCA Final year project Report.
MCA Final year paloreroject ASP.NET.
MCA Final year project Topics.
MCA Final year project in companies.
MCA Final year project in Bangalore.
BCA Final year projects in Bangalore.
Diploma Final year projects in Computer science.
Diploma Final year projects.
Diploma in final year projects in Bangalore.
IEEE projects for computer science.
IEEE projects list
IEEE projects for ECE.
IEEE projects on networking.
IEEE project Titles.
IEEE projects 2013.
IEEE projects in Java.
For more details
contact or walkin to
Aruna Devi T
7483065765
Cegonsoft Pvt.Ltd
#270,Sancia House,14th cross
Domulur Layout,
Bangalore-71.
www.cegonsoft.org
www.cegonsoft.net
|
|
|
|
|
HI,
I am planning to develope a website using dotnet.
Let me the process of developing a website
From front end?
or back end?
how i have to plan
It is movie based website.
|
|
|
|
|
You need more than dotnet, take a look at http://www.asp.net/[^], where you will find lots of useful information.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Wow. Someone really has a hard on for your posts. Countered.
|
|
|
|
|
Thanks again. I guess the answer "Please make an effort to learn", is not always appreciated.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard MacCutchan wrote: "Please make an effort to learn", is not always appreciated.
My thought is people these days want to have solutions already spoon fed to them.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
radha123 from Hyderabad wrote: It is movie based website.
Which means what? That you want the user to be able to view a video of some sort that originated from your site?
radha123 from Hyderabad wrote: how i have to plan
First step - requirements.
For example what is a realistic, not pie in the sky, estimate for the following
- Total number of users
- Average number of users
- Peak number of users
- Number of videos.
- Types of videos (30 seconds, 5 hours, HD, etc.)
- Number of videos
- How the content is managed (all users manage own videos, some users do, only company does.)
- How do the users interact with the system (is it watch one video a day, video editing, searching, etc.)
|
|
|
|
|
Wow. I'm amazed you bother to answer with what was actually asked for.
Personally I feel the responsible answer is something along the lines of "unless this is a pet project to learn, you aren't ready for it; either study and practice for a long time, or hire someone who can program to do the job".
The question betrays that we are dealing with an absolute beginner (by assuming that there is one way in which websites are or should be developed).
|
|
|
|