COM callback with in-process server
Posted on 1998-09-21
We have an in-process server written in D3. We are using connection points to tell the client to take a particular course of action. In order to avoid the server being locked, we had to do run the callback routine on another thread. This I did by marshaling over the interface onto a thread that then makes the callback, and terminates. With an out of process server, all is fine, but with an in-process the problem is that although the reference count is set to 0 (we have tried forcing this) the server does not unload. If it is invoked again, a 2nd instance starts up and so on... We have tried CoFreeUnusedLibraries to no avail. I've tried the same approach in Delphi 4 with mixed results because sometimes it works, sometimes I get an access violation. We are having to go with an out of process server at the moment, but really want to use in-process. Any ideas?