I know how to register dlls but I’ve never really been sure why I’m doing it or under what conditions a dll must be registered. Could somebody explain or point me to some documentation?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When a DLL is registered, the
DllRegisterServermethod entry point in your DLL is invoked. Similarly,DllUnregisterServeris invoked when a DLL is unregistered.As described in this MSDN article:
For COM DLLs, you will need to implement your own
DllRegisterServerandDllUnregisterServerentry point methods which do the registering/unregistering as appropriate. Example code forDllRegisterServercan be found here.The end result of registering a DLL is that all of the CLSIDs for the components in the DLL are registered under
HKEY_CLASSES_ROOT\CLSID. This allowsCoCreateInstanceto find the correct server when instantiating COM objects from another DLL or application.DllUnregisterServerwill do the reverse, and remove all of the CLSIDs from the registry that were put in there byDllRegisterServer.More general information about
DllRegisterServercan be found here.