Re: Sharing a RO std::list between 2 threads & Crash in _Orphan_ptr()



On Sun, 30 Mar 2008 19:54:55 +0200, "h.wulff" <zuhause@xxxxxxx> wrote:

Doug Harrison [MVP] wrote:

When are the functions you mentioned, "erase(), clear() or remove()",
called?

When my shell extension is unloaded, in the destructor. And at this time
the scan thread has already done its work.

I take it then that the thread has exited, and you join with it by using:

WaitForSingleObject(hThread, INFINITE);

You also need to close the handle, of course.

I only use VS 2005 when developing/debugging my shell extension. But I
just saw that even at this time my shell extension isn't linked to
mfc*.dll or msvc*.dll. (According to Dependency Walker) So that should
be ok... ?

As long as you're statically linking to the CRT, and it sounds like you
are, you should be fine.

--
Doug Harrison
Visual C++ MVP
.



Relevant Pages

  • Re: MFC Shell Extension & Threading
    ... Doug Harrison wrote: ... I'm working on an MFC Shell Extension project and need some guidance. ... For reference, I've used a few of Michael Dunn's examples on codeproject.com. ... I've done threading in other languages but I'm struggling finding a definite answer on the best approach to use threading in a Shell Extension. ...
    (microsoft.public.vc.mfc)
  • Re: CFileDIalog crashes when mouse over file
    ... A bad shell extension can call methods inside the shell environment with bad parameters, ... Another thought is that you are damaging the heap in some way (e.g., a buffer overrun) and ... bad shell extension at all, but just a screwup that overwrote memory, memory that is then ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)