DllUnregisterServer
Hello everyone,
I asked a related question about when DllRegisterServer is called and my question is answered. Now I am thinking that when DllUnregisterServer will be called?
It is reasonable to understand that during installation process or when we set Register Output to Yes in Visual Studio 2005, during build process of Visual Studio 2005 regsvr32.exe will invoke DllRegisterServer to put the related registration entries to Windows Registry.
But when (what operation) will trigger DllUnregisterServer be invoked in Visual Studio 2005?
thanks in advance,
George
[605 byte] By [
George2] at [2007-11-20 11:45:37]

# 1 Re: DllUnregisterServer
It will not.
That function is called by an uninstaller before the DLL is removed from the user's computer.
I strongly recommend the following two articles which explain COM very nicely:
http://www.codeproject.com/com/comintro.asp
http://www.codeproject.com/com/comintro2.asp
:)
# 2 Re: DllUnregisterServer
Hi Zaccheus,
My question is not about how to use DllUnregisterServer, but how Visual Studio 2005 will trigger this function automatically.
For example, Visual Studio 2005 could trigger DllRegisterServer automatically if we select Register Output to yes. So, this question is about whether Visual Studio 2005 could trigger unregister as well in its build process or other process.
Any comments?
It will not.
That function is called by an uninstaller before the DLL is removed from the user's computer.
I strongly recommend the following two articles which explain COM very nicely:
http://www.codeproject.com/com/comintro.asp
http://www.codeproject.com/com/comintro2.asp
:)
regards,
George
# 3 Re: DllUnregisterServer
So, this question is about whether Visual Studio 2005 could trigger unregister as well in its build process or other process.
Like I said, Visual Studio will not trigger unregister. That is done by an uninstaller just before the DLL is removed from a user's computer.
Why would you want Visual Studio to unregister the DLL ?
# 4 Re: DllUnregisterServer
Thanks Zaccheus,
It is ok that Visual Studio 2005 does not provide function to unregister it automatically. I just want to save my time to unregister to be lazy. :-)
You know, to manage a couple of install/uninstall reg files sometimes makes me headache...
Like I said, Visual Studio will not trigger unregister. That is done by an uninstaller just before the DLL is removed from a user's computer.
Why would you want Visual Studio to unregister the DLL ?
have a good weekend,
George
# 5 Re: DllUnregisterServer
You know, to manage a couple of install/uninstall reg files sometimes makes me headache...Well, then you'd better stick with batch files rather then regs. ;)
The following command completely unregisters the imaginary dllserver module:
regsvr32 /u dllserver.dll
BTW, this exactly results in DllUnregisterServer call of the mentioned module.
# 6 Re: DllUnregisterServer
Good method, thanks Igor!
Well, then you'd better stick with batch files rather then regs. ;)
The following command completely unregister the imaginary dllserver module:
regsvr32 /u dllserver.dll
BTW, this exactly results in DllUnregisterServer call of the mentioned module.
have a good weekend,
George