-
July 19th, 2005, 04:11 AM
#1
using threads in class libraries
I am converting a windows application which contains timers and threads, to a class library. And i had many problems. Does anyone knows documents or code to get help about this?
-
July 19th, 2005, 04:16 AM
#2
Re: using threads in class libraries
What problems have you had ?
Darwen.
-
July 19th, 2005, 04:30 AM
#3
Re: using threads in class libraries
I think there should not be any problem...
If you think you CAN, you can, If you think you CAN'T, you are probably right.
Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
-
July 19th, 2005, 05:06 AM
#4
Re: using threads in class libraries
I call a function of class library from the main program. The function's last line is:
timer1.Start();
it starts the timer and returns back to the main program, so the timer goes out of scope. I solved this by sending the timer from main program.
Similarly I start a thread, th, and the function(timer_elapsed event) finishes and returns to main program, so th goes out of scope and when the timer elapsed again occurs an error because of;
th.Suspend(); line. Because it forgot it has been started. So I have started the th before th.Suspend() line. I have solved these but I am still facing newer problems.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|