?

Log in

No account? Create an account
 
 
06 December 2004 @ 02:20 pm
Who Is The Crack Smoking Weasel?  
A question came up regarding unloading DLLs from memory. My understanding is that on a Windows system, the way you unload an old version of a DLL and load a new one is to unregister the old DLL (to prevent it from loading again), then reboot the computer (to remove the code that's already in memory from memory.)

1) Is my understanding correct, or is there a way to unload an already loaded DLL from memory without having to reboot the computer.

2) Does the answer to 1 change if this is being done on a Windows 2000 system running DCOM? (Note: Not COM+)


Many thanks to anyone who can shed light on this.
 
 
 
Paul Meyerweregamer on December 7th, 2004 01:19 am (UTC)
Hmm. There are many kinds of DLLs, and the Registry is only important to the ones that implement a COM server. I will presume from context that those are the kind you are talking about. (non-COM Server DLLs have a different set of rules; the COM rules are a special case of those but are such a special case that you can ignore the more general bits.)

Your procedure is the only *guaranteed* way to do it. Unregister the DLL, and optionally register the replacement if there is one, then reboot. You can combine those steps that way.

If you are running DCOM, this is doubly necessary, as you might be serving up those COM components to a remote client you can't even see.



Speaking of such things, and your desire to work for a sane company, we likely will have an opening for somebody who can do C# and understands RDBMS and SQL. IIRC you have mostly worked in VB but have some exposure to C++, so this might be worth putting you in for...
Sandpanthersandpanther on December 7th, 2004 05:32 am (UTC)
Ah, as I expected, the contractor is the crack smoking weasel. We were talking about running DCOM, and it seemed... unlikely... to me that it would be possible to slide a new version in without a reboot.

Hm, yes, working for a sane company would be a very pleasant (and welcome!) change. I maintain a fairly up-to-date copy of my resume on Amurgsval, and I'll try to shoot Max an updated version tomorrow evening.