
Registering proxy/stub for Side by Side COM Components
Ah, you missed the design problem in the very beginning :).
Shared interfaces must NOT have their marshaling support
merged with other code. Put the marshaling code in a separate
DLL and register it in a shared place, then reference count it
for multiple installations.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
Quote:
> > Hmm, interesting article. All I can says is that the NDR layer does
> > not support side-by-side sharing. Subsequently, you must install
> > all proxy/stub DLLs in shared locations. Note there's no DLL hell
> > here since these only support already immutable interfaces. The
> > biggest issue is to ensure each newer version supports all interfaces
> > supported by any previous version, and subsequently always install
> > the latest version.
> Actually this is not exactly correct. I can manually edit the registry
> to change the HKCR\CLSID\{GUID}\InProcServer32 default key to a relative
> path and it works great.
> I would agree with you "that NDR layer does not support side-by-side
> sharing" if I was trying to use the proxy stub pair for DCOM. I just
> need the proxy for marshaling across apartment boundaries in the same
> process.
> There is definitely a possibility for DLL hell problems with the proxy /
> stub. When multiple copies of an application using absolute paths the
> registry key can only point to one of the installations. If the pointed
> to application is uninstalled the other installations will break.
> If the registry entries are created with relative paths the registry
> entry can be referenced counted. The entry would only delete when the
> last copy of the proxy is uninstalled.
> The issue is not trying to make an interface mutable. I merge the proxy
> and stub code into the component DLL. Since the proxy is in the same
> DLL as the component it can't be installed in a shared location. I
> simply want the install for an application to stand alone.
> I have found several articles from Microsoft recommending that new COM
> components be designed to run side-by-side. The problem is none of these
> articles addresses the issue of registering the proxy.