In one of my projects I needed to script a class inside a .NET executable.
.NET has very good support for in-proc COM components: you create a class library, add a class, put
[ComVisible] attribute on it, and voila – you’ve got yourself a COM object. Scripts would instantiate this component via a
CreateObject call, which would locate the DLL and load it into the client’s address space.
My scenario, however, was slightly different. I did not want a new instance of my component to be created inside the client process. I already had an instance in my own process, and I wanted to script it.