--- In [email protected], "entropyreduction" 
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "swzoh" <seanzoh@> wrote:
> > What value did you use for COWAIT_FLAGS? It should/better be 0.
> 
> Oops.  I used COWAIT_WAITALL.  I'll try again with 0 next week when I'm back 
> with my compiler.
>

Yes, I noticed that the symptom was exactly that of COWAIT_WAITALL. This flag 
should be used very carefully as it causes to wait for all handles AND (:notice 
not OR) message. I think the only feasible flag which can be set safely in this 
context is COWAIT_INPUTAVAILABLE.

> I put OleUninitialize back in code run by com.unload.  Works fine.
> 
> I think most of my problems were caused by trying to do stuff in the 
> DLL_PROCESS_DETACH section of DllMain that shouldn't be done there.
> OleUninitialize, setting events, causing threads to run, suspend and finally 
> exit...all too much as consequences of FreeLibrary call.
>

What can be done in DllMain is very limited:
http://msdn.microsoft.com/en-us/library/ms682583%28VS.85%29.aspx

Reply via email to