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.
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.
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'.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)