When trying to stop a process using a thread.abort I get an error " system null ref. exception in Windows.Form.dll" " Obj ref. not set insatance of Obj" and end up in debug mode with Form1 highlighted in green.When stepping through the code , it goes to error imediatelly after sub "Schedule" is stepped off of.
Any insight would be appreciated.
Also, When I am displaying Form1 and a user control(brought to front) which shows a progress bar, why can I not get access to a button on the form1(abortBtn) to initiate thd.abort?
representative code:
Form1
Any insight would be appreciated.
Also, When I am displaying Form1 and a user control(brought to front) which shows a progress bar, why can I not get access to a button on the form1(abortBtn) to initiate thd.abort?
representative code:
Form1
VB.NET:
dim thd as system.threading.thread
dim abortBtn as new button
private sub InitSch()
'
'
dim thd as new System.threading.thread(addressof Schedule)
thd.start
end sub
private Sub Schedule()
'
'
SubA()
SubB()
end Sub
private sub abortBtn_click()
thd.abort
end sub
private Sub SubA()
end sub
private Sub SubB()
end sub
Last edited by a moderator: