Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does anyone have a program to remove a DLL from memory?

Status
Not open for further replies.

steveblum

Programmer
Aug 6, 1999
55
US
Does anyone have a program to remove a DLL from memory?<br><br>I am writing a DLL in VB and referencing it in another project.&nbsp;&nbsp;Whenever I recompile the DLL, I have to reboot before the new copy takes effect in my other project.&nbsp;&nbsp;I'd like to be able to just remove the DLL from memory so it would reload again when my project referenced it.&nbsp;&nbsp;Does anyone have such a program?<br><br>Thanks.
 
I am working on a program to do just that. <br>I think that your problem could be solved if you set the properties of your dll to Binary compatability. If before you re-compile your dll you remove the reference to it. when you have compiled you should be able to select the new dll. <br><br>If this doesn't work then give me some more information o the Dll and the referencing project and I'll see what I can do.<br><br>Hope this helps <br><br>
 
Guys,<br><br>Thanks for the help.&nbsp;&nbsp;Nick, I went to that site and downloaded PsKill and a couple others, but PsKill will only kill a process (mostly EXEs), not a DLL.&nbsp;&nbsp;I found HandleEx, which will show me loaded DLLs, and where they were loaded from, but it is read-only information.<br><br>Vince,<br>As far as what I am doing exactly, I am writing a DLL in VB that is loaded into MTS on a server.&nbsp;&nbsp;I've exported the package and installed it back on my computer.&nbsp;&nbsp;That puts a copy of the DLL and a reference in the registry to the version running on the Server.&nbsp;&nbsp;In another VB project, I reference that DLL so I get some enums and early binding.&nbsp;&nbsp;Therefore, VB runs the copy of the DLL on my client whenever I open that project.<br><br>To make changes to the DLL I do this:<br>Open the project in VB<br>Make the changes and Save<br>Compile a new copy of the DLL to my computer<br>Copy the DLL to the server<br>Remove and reinstall the DLL in MTS on the server<br>In MTS, Export that package (creates an EXE that can be run on a client computer to allow remote calls to that package)<br>On the client computer, run the export EXE to install an updated copy of the DLL and update the registry<br><br>At this point if I try to run my client app, any reference to the DLL will fail if I've made any changes to the interface of the DLL.&nbsp;&nbsp;Dropping the reference, closing VB, etc. don't help because the DLL is still in memory and doesn't get reloaded when I reopen the project and readd the reference.<br><br>To get around this, I reboot, and I'm back in business.&nbsp;&nbsp;I'm just wanting a utility to let me kill the DLL from memory, so I can close and reopen VB, and it will load the new copy of the DLL, without having to reboot.<br><br>That's the whole enchilada.&nbsp;&nbsp;Let me know if you have any other suggestions.<br><br>Thanks.<br>
 
Steve,&nbsp;&nbsp;The reason that your server side application doesn't recognize the DLL is most likely due to the project not having Binary Compatability set on the DLL.&nbsp;&nbsp;When a DLL get's compiled, it gets a set of GUID's assigned to it that uniquely identify it.&nbsp;&nbsp;Check the following sites for more information.<br><br><A HREF=" TARGET="_new"> article that I highly recomend is by Francesco Balena.&nbsp;&nbsp;This guy really nails it down in the following article.&nbsp;&nbsp;It gets pretty deep, but I found it to be EXCELLENT!<br><br><A HREF=" TARGET="_new"> find that if you understand how it works under the hood, it makes for great defensive programming. <p>Steve<br><a href=mailto:tribesaddict@swbell.net>tribesaddict@swbell.net</a><br><a href= > </a><br>
 
Try using RegClean. It will check your system registry and fix any errors you have. Best of all, it's free.<br>I also agree about setting Binary Compatability when you re-compile.<br>Good luck<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top