Registering a COM without Admin rights

For what it’s worth, I’ve written a set of C# utilities that register/unregister a .NET type (should be marked as ComVisible of course) in user’s registry without requiring regasm, nor UAC prompts, you can use it like this: // register into current user registry, needs no specific rights ComUtilities.RegisterComObject(ComUtilities.Target.User, typeof(MyClass)); // unregister from user registry, … Read more

64 bit C# with a 32 bit VB6 COM object

There’s no direct way you can do this. Since you can’t port the VB6 inproc dll I’d suggest you write a 32bit out of process server that implements the same interfaces and have it delegate down to the VB6 code. Then, your 64bit app can call the out of process server as COM will take … Read more

Active Directory COM Exception – An operations error occurred (0x80072020)

The issue is often that the context for which the Active Directory calls is made is under a user that does not have permissions (also can happen when identity impersonate=”true” in ASP.NET, due to the fact that the users token is a “secondary token” that cannot be used when authenticating against another server from: https://social.technet.microsoft.com/Forums/en-US/f188029c-51cf-4b50-966a-eee7160d0353/an-operations-error-occured). … Read more

Equivalent code of CreateObject in C#

If you are using .net 4 or later, and therefore can make use of dynamic, you can do this quite simply. Here’s an example that uses the Excel automation interface. Type ExcelType = Type.GetTypeFromProgID(“Excel.Application”); dynamic ExcelInst = Activator.CreateInstance(ExcelType); ExcelInst.Visible = true; If you can’t use dynamic then it’s much more messy. Type ExcelType = Type.GetTypeFromProgID(“Excel.Application”); … Read more