title: How to reload a 3rd party DLL that crashes often
body: <p>I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware we have.</p>
  
  <p>Unfortunately this DLL crashes now and then and I've been tasked to make it "reload" automagically. I'm not too sure about how to proceed to get best results.</p>
  
  <p>My project uses C++.Net 2.0 (2005). I'm wrapping the 3rd party stuff in a separate DLL. I've been trying to FreeLibrary() and LoadLibrary(). However when I FreeLibrary(), some internal DLL dependencies remain allocated and LoadLibrary() will make it crash because of corrupted memory.</p>
  
  <p>Another approach that was suggested was to refactor the whole project using .NET remoting interfaces. It would make it easier to kill another process and restart it but it will be a lot of work.</p>
  
  <p>Any suggestions? Pointers? Hints?</p>