Vb.Net App does not allow system to log off when running
-
Hi All As my subject suggest i have a vb.net Application. Whilst its running does not allow my computer to logoff. I have tried this on two other machines to no avail. Any suggestions. ?? I didnt include code because I don't think its necessary . Cheers Dom
-
Hi All As my subject suggest i have a vb.net Application. Whilst its running does not allow my computer to logoff. I have tried this on two other machines to no avail. Any suggestions. ?? I didnt include code because I don't think its necessary . Cheers Dom
Windows would prefer all applications to end cleanly when it shuts down. It therefore waits until they do so. But after a while it should pop up a dialog asking if you want to "End Now" which forces the application to close. The application is obviously not responding to the shutdown event. This could be because it is performing an extended operaration without responding to events. Why type of application is this?
Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
Windows would prefer all applications to end cleanly when it shuts down. It therefore waits until they do so. But after a while it should pop up a dialog asking if you want to "End Now" which forces the application to close. The application is obviously not responding to the shutdown event. This could be because it is performing an extended operaration without responding to events. Why type of application is this?
Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
Hi Colin thats what I thought so something must be wrong. Its a windows app. Its starts off with a form starting at runtime named Hidden here is the code that triggers at load
Private Sub Hidden_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load xSock.UDP_Listen(10080) AddHandler xSock.DataArrival, AddressOf UDPArrival End Sub
in the above code it calls a class method as belowPublic Shared Function UDP_Listen(ByVal Port As Integer) As Boolean Try UDP_Server_Port = Port UDP_Server = New UdpClient(Port) thdUdp = New Thread(AddressOf GetUDPData) thdUdp.Start() Catch e As Exception RaiseEvent Sock_Error(e.ToString) End Try End Function Private Sub UDPArrival(ByVal vData As String) TextBox1.Text = vData txtText.Text = vData xSock.UDP_Send("127.0.0.1", 10090, vData) End Sub
so can you see how i can resolve this issue ? THanks so far :) -
Hi Colin thats what I thought so something must be wrong. Its a windows app. Its starts off with a form starting at runtime named Hidden here is the code that triggers at load
Private Sub Hidden_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load xSock.UDP_Listen(10080) AddHandler xSock.DataArrival, AddressOf UDPArrival End Sub
in the above code it calls a class method as belowPublic Shared Function UDP_Listen(ByVal Port As Integer) As Boolean Try UDP_Server_Port = Port UDP_Server = New UdpClient(Port) thdUdp = New Thread(AddressOf GetUDPData) thdUdp.Start() Catch e As Exception RaiseEvent Sock_Error(e.ToString) End Try End Function Private Sub UDPArrival(ByVal vData As String) TextBox1.Text = vData txtText.Text = vData xSock.UDP_Send("127.0.0.1", 10090, vData) End Sub
so can you see how i can resolve this issue ? THanks so far :)you're problem is (I think) you start a new threat but never stop and close it so this thread still exists and on shutdown (of windows) windows does not know what to do with it (I think) try the following (just a guess) in the formclosing of you're main form put application.exit this should close all threads at once or you could just close the thread when it has finished hope this helps
-
you're problem is (I think) you start a new threat but never stop and close it so this thread still exists and on shutdown (of windows) windows does not know what to do with it (I think) try the following (just a guess) in the formclosing of you're main form put application.exit this should close all threads at once or you could just close the thread when it has finished hope this helps
-
yep gave it a try but no luck unfortunately I have a sneeky feeling the form_closing is not firing when i try to exit or lof off.. surely someone knows why my crappy code is not working thanks anyway TDDragon =)
Is there not an event on the application class that fires when Windows issues a shut down command? (It's been a while and I might be a bit rusty on that)
Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
Is there not an event on the application class that fires when Windows issues a shut down command? (It's been a while and I might be a bit rusty on that)
Upcoming FREE developer events: * Glasgow: Agile in the Enterprise Vs. ISVs, db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website
-
Hi Colin thats what I thought so something must be wrong. Its a windows app. Its starts off with a form starting at runtime named Hidden here is the code that triggers at load
Private Sub Hidden_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load xSock.UDP_Listen(10080) AddHandler xSock.DataArrival, AddressOf UDPArrival End Sub
in the above code it calls a class method as belowPublic Shared Function UDP_Listen(ByVal Port As Integer) As Boolean Try UDP_Server_Port = Port UDP_Server = New UdpClient(Port) thdUdp = New Thread(AddressOf GetUDPData) thdUdp.Start() Catch e As Exception RaiseEvent Sock_Error(e.ToString) End Try End Function Private Sub UDPArrival(ByVal vData As String) TextBox1.Text = vData txtText.Text = vData xSock.UDP_Send("127.0.0.1", 10090, vData) End Sub
so can you see how i can resolve this issue ? THanks so far :)It would appear your UI thread is blocked somewhere, but it's not obvious in the code you've posted. Single step through the execution of your server and watch the code run, line-by-line. If the debugger gets to a statement where it stops and doesn't execute the next line, you've found the block.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007