Click here to Skip to main content
15,883,731 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello Friends,

Why DLLs need registration? Which of the dll need registration in vc++ and other languages? Why we used three types of dll in vc++ i.e. regular, extension and non-mfc?
Please explain these.
Posted
Updated 9-Jan-13 4:31am
v2
Comments
Richard MacCutchan 9-Jan-13 8:38am    
Your question is not clear. If yuu have COM enabled libraries then they should be registered. If they are just "standard" C++ libraries then they just need to be in the library search path for the loader.
Sergey Alexandrovich Kryukov 9-Jan-13 9:43am    
My 5. I would skip explanation of how COM works (and advice to avoid using it, if possible)...
—SA
Vaibhav_J_Jaiswal 9-Jan-13 9:54am    
Is any link which explaining the working with and registration of dll?
Richard MacCutchan 9-Jan-13 10:00am    
The first question you need to answer is "why do my DLLs need registration?"

You have not explained where these DLLs come from, what they will be used for, or why you think they need registration. Please update your question with some more details about your problem.

There are actually more 'types' of DLLs than you have listed here but for these, the difference is largely what they are linked to.

If a DLL has a COM/DCOM/COM+ interface it needs to be registered to be fully useful.

[small lie] If a DLL contains managed code, it is called an assembly and is treated differently as well.
 
Share this answer
 
Comments
Vaibhav_J_Jaiswal 10-Jan-13 5:09am    
Why DLLs need registration? Is any link which explaining the working with and registration of dll?
H.Brydon 10-Jan-13 10:40am    
A DLL does not need registration unless it has a COM/DCOM/COM+ interface (which I will call "COM"). If you are not writing a COM DLL then you don't need to register it for anything. In fact I would discourage you from writing anything COM. If you really want to know about it, I suggest 3 links http://www.microsoft.com/com/default.mspx , http://en.wikipedia.org/wiki/Component_Object_Model , and http://stackoverflow.com/questions/900123/com-com-dcom-where-to-start . If you don't know what COM is, don't start, and your DLL(s) likewise do not need registration.
Your question leads to some complex topics, but I think I can break it down into some simple answers. Note that there are exceptions and ways to get around limitations I've outlined, but for most of your work, they'll hold up.


Regular - Standard DLL type for windows. Can reference MFC components, but MFC components cannot be safely passed between the application and the DLL. Specifically, memory that has been allocated in one cannot be freed in another. It's LIB fixups and load time, can be separate from your process. Care must be taken to maintain strict boundaries between your process and DLL. This DLL can have different compile and link options than your process.

Extension - This type of DLL fully supports MFC and allows safe passing of MFC objects and allocation and deletion of memory and objects between the process and DLL. This type of DLL, shares LIB fixups when loaded and you must take care to compile and link it using the same models as your process. Example, Multi-Thread, MFC, Unicode, etc...

Non-MFC - This DLL does not provide support for MFC and code in this DLL cannot make or share MFC calls. It shares many traits with the 'Regular DLL'.
 
Share this answer
 
Comments
Vaibhav_J_Jaiswal 10-Jan-13 5:09am    
Why DLLs need registration? Is any link which explaining the working with and registration of dll?
JackDingler 10-Jan-13 11:07am    
That questions has been answered.

Not all of them do. But those that contain COM objects or .Net assemblies do, because they publish object GUIDs into the registry so that applications can find them w/o knowing beforehand, the DLL file name or path.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900