Why exactly do I need an explicit upcast when implementing QueryInterface() in an object with multiple interfaces()

The problem is that *ppv is usually a void* – directly assigning this to it will simply take the existing this pointer and give *ppv the value of it (since all pointers can be cast to void*). This is not a problem with single inheritance because with single inheritance the base pointer is always the … Read more

Will Microsoft Edge support COM automation (InternetExplorer object)?

Microsoft Edge will not support the COM automation interface (InternetExplorer object) that you referred to. For automation scenarios, our direction is to support of the WebDriver interface that is supported across browsers. WebDriver support is now available in Microsoft Edge on Windows 10 and requires a separate executable that you can download. To get an … Read more

Error accessing COM components

Problem solved! I have previously installed Office 2010, so there are some inconsistences in Windows Registry. To fix them, open the regedit and find for the CLSID from the error. You will find something like that for the second error: HKEY_CLASSES_ROOT\Interface\{00020970-0000-0000-C000-000000000046} With the subkeys: ProxyStubClsid ProxyStubClsid32 TypeLib Take a look at the (Default) and Version … Read more

How do I properly instantiate 32-bit COM objects in classic ASP after installing Windows Update KB4340558?

We were affected with multiple customers too. I ruled out invalid strong-name signing of our assemblies, since the .NET Assemblies from the Framework itself were affected by that access-denied error too. Finally I managed to solve the issue by configuration. Apparently the authenticating identity of the website has now to match the identity of the … Read more

Best way to access COM objects from C#

If the library is already registered, you can perform the following steps to have Visual Studio generate an interop assembly for you: Open to your Visual Studio project. Right click on ‘References’ (right under the project in your Solution Explorer) and select ‘Add Reference’. Select the COM tab. (If you don’t see this, you have … Read more

The proper way to dispose Excel com object using VB.NET?

First – you never have to call Marshal.ReleaseComObject(…) or Marshal.FinalReleaseComObject(…) when doing Excel interop. It is a confusing anti-pattern, but any information about this, including from Microsoft, that indicates you have to manually release COM references from .NET is incorrect. The fact is that the .NET runtime and garbage collector correctly keep track of and … Read more