Minimal COM object registration
Yesterday I mentioned the APPID registry key. I also mentioned the effort going on within Microsoft to reduce redundant COM related registry keys.
We use about a dozen COM objects internally within the audio subsystem of Vista, and after talking to the COM guys about what we REALLY need to specify, we've settled on the following for registration of the objects. I believe it's the minimal set of registry values you need to have a fully functional COM object:
Default Value: "Friendly Name for the class" not actually required, but useful for tools like oleview and dcomcnfgKey: HKEY_CLASSES_ROOT\CLSID\<clsid>\InprocServer32\"
Default Value: REG_EXPAND_SZ: <DLL Name>
Value "ThreadingModel" REG_SZ "both"
That's it - two keys and a single non default value.
Of course, by specifying such a restricted set of keys, you lose a lot of functionality. For instance, since there's no PROGID specified, you can't call CLSIDFromProgID or activate the object via name (such as using the szProgID version of the CComPtrBase<>::CoCreateInstance method). In addition, without additional information, you can't marshal the object cross process. It's also not accessible from script, or from the CLR (because there's no typelib registered). And finally, while the object is marked with a threading model of "both", it can't be used from the STA unless the COM object aggregates the FreeThreadedMarshaller.
But if all you need is to be able to have an application activate your COM object in-proc, this is all you need.
Next: What do you need to add if you need your object to work cross-process?
Edit: Added note about aggregating the free threaded marshaller.