G
Guest
Hi,
I created application that I get information from AS400 for reporting.
In main.exe has only 1 frm which calls (as a class library) CLS_MAIN.dll.
The CLS_MAIN.dll get the tables from AS400 and stores it in Dataset.
Then returns to main frm then main frm calls the FirstReport.dll.
The FirstReport.dll get the information from access database and creates the
sqkl string and works with dataset and then writes in pre-formated Excel
sheet.
I create main_thread in main form(frm) that calls for CLS_MAIN(dll), then
FirstReport(dll) and WriteInEXCELL(dll).
Now while is doing this I createted cancel button. Main purpose of this that
user can be able to cancel creating first report and can goto second report.
But I cannot be able to stoping the thread. When I use serverThread.Abort()
it goes to main form and when user try to create second Report gets exepction
that Thread did not stoped or cannot create same thread again.
I want to cancel the thread then user can send different parameter so she or
he can be able to create different report.
I learn that I should use the serverThread.Join() after the calling the
serverThread.Abort(). But I don't know how to applie to my application.
I also like to know how to unload the class(dll's).
I thank you in advance to helping me out.
Rgds,
Niyazi
I created application that I get information from AS400 for reporting.
In main.exe has only 1 frm which calls (as a class library) CLS_MAIN.dll.
The CLS_MAIN.dll get the tables from AS400 and stores it in Dataset.
Then returns to main frm then main frm calls the FirstReport.dll.
The FirstReport.dll get the information from access database and creates the
sqkl string and works with dataset and then writes in pre-formated Excel
sheet.
I create main_thread in main form(frm) that calls for CLS_MAIN(dll), then
FirstReport(dll) and WriteInEXCELL(dll).
Now while is doing this I createted cancel button. Main purpose of this that
user can be able to cancel creating first report and can goto second report.
But I cannot be able to stoping the thread. When I use serverThread.Abort()
it goes to main form and when user try to create second Report gets exepction
that Thread did not stoped or cannot create same thread again.
I want to cancel the thread then user can send different parameter so she or
he can be able to create different report.
I learn that I should use the serverThread.Join() after the calling the
serverThread.Abort(). But I don't know how to applie to my application.
I also like to know how to unload the class(dll's).
I thank you in advance to helping me out.
Rgds,
Niyazi