Hi Bruce,

Trying to work out problem when com.dll is loaded and powerpro is shut down and 
doesn't.

Problem stems from this:  at moment when DllMain needs to do stuff for 
DLL_PROCESS_DETACH, it needs to cause all com objects to be released.  

To do that it has to set up some flags, set an event that allows the sleeping 
com worker thread to run, then wait for another event that's signalled by that 
thread when it's done.  All that's too much for the consequences of what I 
assume is a simple FreeLibrary call in your shutdown code.

One alternative is that my unload code doesn't attempt to release any existing 
com objects: it just kills the worker thread.  Rules of usage would be:

(a) if you create any global or static handles to com objects, you have to kill 
them before you exit powerpro.  A single call to com.releaseAll in PProShutdown 
list would do it.

(b) if you create any local handles to com objects in a script which then calls 
Powerpro.shutdown, you must call com.releaseAll before you call 
Powerpro.shutdown.

The alternative is to leave things as they are, and require users to always 
call com.unload in PProShutdown list.

Thoughts?


Reply via email to