COM interop does not necessarily create one interop library for one COM library. This is only the default behaviour of the type library importer. It is also possible to provide one interop assembly for multiple COM libraries or multiple interop assemblies for one COM library.
An interop assembly is not even linked to an COM library! It can be easily deployed without the source library installed on the target system. In fact, it will fail as soon as you are trying to create an instance of one of the libraries objects. The objects inside an interop assembly are important when you want to find their source. They are called Runtime Callable Wrappers (Runtime stands for the CLR). That's the reason why your interop assembly is called RCW.Xyz.dll
. Propably the developer of the assembly used tlbimp's /out
switch to create it.
When you want to search for the library, a certain COM type is defined in, just find the class name inside the interop assembly. You can use Visual Studio's object explorer to do this - no need to dissassemble the interop assembly. Those assemblies usually do not define any code at all. They only provide metadata to satisfy the CLR. Each class is marked with a ComImport
attribute and a Guid
attribute. Use this GUID to identify the class inside your registry (HKEY_CLASSES_ROOT\CLSID\{GUID}
as you mentioned in your answer). The Inproc32
key's default value is the library the type is defined in. Note that this only applies to inproc COM servers (DLL's; COM als supports other library types).
As mentioned above, this must actually be done for each class. However, if the developer of the interop assembly used the type library importer to generate the interop assembly and did not modify or merge it with others, it should be enought to do it only for one type, because of tlbimp's default behaviour, mentioned earlier.