Is it possible to use a COM component without registration, without registering it on the development machine?

I have a COM component for registration that I have developed that works fine on target machines without the need to register the component. It is in a dll with built-in tlb and an RT_MANIFEST resource, which has a manifest that lists the assembly dependencies and CLSID for the component.

In Visual Studio (2008), I still need to register this COM component in order to accomplish at least two things that I have tried. When adding a link to a component, I cannot select an isolated property for the link if the component is not registered. I also cannot create instances of the object when the debugger is running until the component is registered. However, I can add the link and compile the application and run it without registering the component.

Is there any way to use the COM component without registering in Visual Studio without registering it, or is it necessary to register it on the development machine for everything to work correctly?

+4
source share
1 answer

It is important here to understand the difference between compilation time and COM component runtime. Reg-free COM is just a runtime function. The selected manifest describing the COM interface is a non-registration part. You do not need to register the COM component in the registry. Instead, you send the registration information to a file. This means that you do not need an installer. It also means that you are isolated from registration problems. Better known as DLL Hell.

The keys in the registry or the entries in the manifest are important to help COM figure out which DLL to load when the COM client asks it to create an instance of the COM object.

This is very different from compilation time. The type library is very useful to tell the compiler if you wrote the correct code correctly. Does the COM component really have an IFoo interface? Does the IFoo interface really have a Mumble () method that takes two arguments? The type library tells the compiler what the interface looks like, and allows the compiler to do a static check of the code you wrote. Differs from β€œlate binding” btw, an option that allows you to write client COM code without a type library (and thus without type checking). Normal in scripting languages.

I repeat: without registering COM, it’s just about installing, not writing code.

+8
source

All Articles