M
Mitch Wardrop
ok here it goes I must be doing something way off but it makes sense to
me just not to VB.NET which would be a huge problem. Anyways I'll
explain what I am doing than give code examples. basicly I've declared a
thread in a module file where all my variables are declared for the
enitre application, than it calls the thread from the main form and runs
a sub routine located in a different class (I call it "work" class, this
is where all the code that actually does anything is stored), the thread
executes and begins dumping database data no problem, then when I open
up my disconnect dialogue window and click yes to disconnect and tell my
thread to quit it never quites in fact it just hangs the program, not
sure why. Anyways heres the code I am using if anyone can tell me what
is going on I would appreciate it.
file name : variables.vb
Module variable
'Define Global Variables
Public database As String = "WELLDAQ\DBINFO"
Public dbusername As String = "******"
Public dbpassword As String = "******"
'job is declared by the work.activejob() routine called from the
start form
Public job As String
Public jobid As Integer
Public dumplocation As String = "C:\uploader"
Public jobtype As String
Public server As String = "dkdserver.ath.cx"
Public serverusername As String = "******"
Public serverpassword As String = "******"
Public disconnect As Boolean = False
Public active As Boolean = False
Public company As String
Public dumpcount As Integer
Public uploadcount As Integer
Public connect = New Global.System.Threading.Thread(AddressOf
Work.Connect)
End Module
Filename : Main.vb
Imports System.Threading
Public Class Main
Private Sub Connect_Button_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Connect_Button.Click
variable.connect.Start()
End Sub
End Class
Filename : disconnect.vb
Imports System.Threading
Public Class disconnect_form
Private Sub Yes_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Yes.Click
variable.connect.kill()
Me.Close()
End Sub
End Class
me just not to VB.NET which would be a huge problem. Anyways I'll
explain what I am doing than give code examples. basicly I've declared a
thread in a module file where all my variables are declared for the
enitre application, than it calls the thread from the main form and runs
a sub routine located in a different class (I call it "work" class, this
is where all the code that actually does anything is stored), the thread
executes and begins dumping database data no problem, then when I open
up my disconnect dialogue window and click yes to disconnect and tell my
thread to quit it never quites in fact it just hangs the program, not
sure why. Anyways heres the code I am using if anyone can tell me what
is going on I would appreciate it.
file name : variables.vb
Module variable
'Define Global Variables
Public database As String = "WELLDAQ\DBINFO"
Public dbusername As String = "******"
Public dbpassword As String = "******"
'job is declared by the work.activejob() routine called from the
start form
Public job As String
Public jobid As Integer
Public dumplocation As String = "C:\uploader"
Public jobtype As String
Public server As String = "dkdserver.ath.cx"
Public serverusername As String = "******"
Public serverpassword As String = "******"
Public disconnect As Boolean = False
Public active As Boolean = False
Public company As String
Public dumpcount As Integer
Public uploadcount As Integer
Public connect = New Global.System.Threading.Thread(AddressOf
Work.Connect)
End Module
Filename : Main.vb
Imports System.Threading
Public Class Main
Private Sub Connect_Button_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Connect_Button.Click
variable.connect.Start()
End Sub
End Class
Filename : disconnect.vb
Imports System.Threading
Public Class disconnect_form
Private Sub Yes_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Yes.Click
variable.connect.kill()
Me.Close()
End Sub
End Class