CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    Turkey
    Posts
    54

    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?

  2. #2
    Join Date
    Jan 2002
    Location
    Scaro, UK
    Posts
    5,940

    Re: using threads in class libraries

    What problems have you had ?

    Darwen.
    www.pinvoker.com - PInvoker - the .NET PInvoke Interface Exporter for C++ Dlls.

  3. #3
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503

    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.

  4. #4
    Join Date
    Jun 2005
    Location
    Turkey
    Posts
    54

    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
  •  





Click Here to Expand Forum to Full Width

Featured