tags:

views:

24

answers:

2

Can more than .DLL of the same name be registered on a machine?

Eg. If I have MyDLL.dll in both c:\ and c:\MyDLLs, is it possible to register both MyDLL.dll files? If I do this, which MyDLL.dll will be used if an application tries to access MyDLL.dll?

A: 

(Source: http://www.codenewsgroups.net/vb/t2754-dll-hell-query.aspx)

If they have the same file name then they cannot co-exist in the same directory. One will have to be renamed, or moved. If they're ActiveX DLLs then the file name is less important than the associated ProgID/ClsID used for registration -- except that renaming it might upset a subsequent uninstall or re-install of the software from that vendor.

Assuming they have different ProgIDs and ClsIDs then there should be no problem in registering them. But if you can try to avoid this.

P.S. Check the link above for some good insight.

Sidharth Panwar
A: 

Most likely your question around DLL which implements a COM component. It actually uses a GUID (globally unique identifier) which it looks up in the registry under hkey_classes_root/clsid and there in the sub-keys is a scheme for pointing to the physical location.

To start understanding this, open the regedit, and do a control-f find the full path to both of the DLLs in question - you'll see exactly what I'm talking about.

Gabriel