CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Keeping a thread alive

    I'm creating a thread inside a dll, is it possible to set the thread so that when the process that loaded the dll dies, the thread will continue to execute ?


  2. #2
    Join Date
    Aug 1999
    Location
    Bulgaria
    Posts
    236

    Re: Keeping a thread alive

    The process kills all its threads so this is not possible, but it does not kill all processes that has initiated. So use a process instead of a thread.


  3. #3
    Join Date
    Apr 1999
    Location
    Sofia, Bulgaria
    Posts
    57

    Re: Just Set a Win hook

    Use any windows hook (SetWindowsHookEx())
    Windows hook makes your dll to be loaded in each running Win32 process address space (also in new created after hook is set)

    in dll init proc create the thread, (have in mind thread will not start executing while DllMain is on reguardless how you create it - so do not wait events from thread in DllMain - you will screw all proccesses)

    This will make all processes in system to have additional thread - so in order not to decrease performance you shall have something that filters which proccess to have thread and which not.

    WISH YOU Good luck in synchronizing these threads


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