FindExtensionByCLSID from another process - fixed (not-a-problem)

Discussion created by sgirbau on Aug 16, 2011
Hello all,
can FindExtensionByCLSID (or FindExtensionByName, for that matter) be called from a COM out-of-process context?

That is, a separate EXE of mine obtains an IApplication object (referring to a running instance of ArcMap), and tries to grab an IExtension using one of the above methods. I'm always getting the error "COM object that has been separated from its underlying RCW cannot be used".

This occurs regardless of whether the extension is one of ESRI's own (like "esriEditor.Editor"), or one extension of mine implemented as a native (compiled) DLL, or another extension of mine implemented as a C# assembly - so far I've never been able to successfully call FindExtensionByCLSID from another process.

Any success story is appreciated! Thanks in advance.

P.S., next day: I should have mentioned (if not clear by context) that the caller of FindExtensionByCLSID is a C# application. I just tried today of doing the same from VB6 (brain-dead language, but it has the one redeeming virtue of being, by definition, a scripting language for COM objects) and from VB6 it works with no problem, returning a pointer to any extension I want, calling from the VB6 separate process. But I don't understand COM Interop that much as to see where the problem is.

P.P.S.: *embarrased*: My fault, the IApplication object was being used after being released. Nothing to do with FindExtensionByCLSID; if I had tried to extract, say, the Name property of the IApplication, I would've got the same error. Please ignore this message!