1,883 questions
1
vote
0
answers
57
views
How to replace a COM Interop with the ComWrapper Source Generator?
I am currently using a COM Interop DLL, generated with tlbimp, to access a proprietary COM library from C# (net8), so no source code available (TLB embedded in DLL). It works, but stops me from using ...
0
votes
0
answers
26
views
"Object required" error with.NET 8 ComVisible object created with CreateObject() [duplicate]
I've created a simple counter class using .NET 8 and C#:
SimpleCounter.cs
using System.Runtime.InteropServices;
namespace Counters
{
[ComVisible(true)]
[Guid("01FB5599-3CD1-462E-98AA-...
1
vote
1
answer
51
views
ASP.NET web application : Dcom configuration interop exception
I have an ASP.NET web application to export an Excel file with multiple sheets. Each sheet contains multiple tables on it created using Microsoft.Excel.Interop.Services package. The export ...
4
votes
1
answer
171
views
RegFree COM in VBA - ClassFactory cannot supply requested class
Working on creating a .NET 8 library which will be called from Excel VBA via COM interop. I've had some success setting this up using regsvr32, but having gone down that path on earlier projects, I'm ...
1
vote
1
answer
85
views
What makes Notepad (and others) open behind my program when invoked through an IExplorerCommand?
I've written a Windows Explorer clone, and while it's been an adventure, most of the stuff is now working fine.
But, I have this problem: when I right-click an item and the Windows 11-style Explorer ...
1
vote
1
answer
170
views
Implement IDispatch-only interface easily in C++
I defined the following IDispatch-only interface in my C# project:
[ComVisible(true)]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[Guid("3532C4E8-D320-487C-8BD4-...
0
votes
0
answers
47
views
My WPF application crashes intermittently when working with multiple windows
I have an application built with WPF using .Net framework 4.8 and windows APIs which runs as a windows application and opens an excel app (separate excel process) and from the excel app opens up a ...
0
votes
1
answer
220
views
How to not use builtin com interop to make trimming work in .NET
In C# .NET 8 given a pointer (IntPtr) to a native object implementing a COM-compatible interface and a C# interface definition, how do I convert the pointer to an object implementing such interface ...
1
vote
1
answer
111
views
C# DLL with [ComSourceInterfaces] Attribute Not Working in VBA WithEvents
I am trying to use a C# DLL in VBA with events using the [ComSourceInterfaces] attribute, but I am encountering issues. Here's what I have so far:
C# Code
ITaskRunnerEvents.cs
using System;
using ...
1
vote
1
answer
100
views
C# COM INTEROP and VB6 - Resources not being released
I have a C# .netFramework4.8 COM INTEROP library that takes data and puts it into a .pdf file to be saved somewhere. This involves PDFSharp, as I need to take pages out of existing .pdf files and ...
0
votes
0
answers
54
views
How do I know when my COM object is released?
I'm implementing drag and drop and clipboard copy/paste with CFSTR_FILEDESCRIPTOR and CFSTR_FILECONTENTS with IStream. So I implemented my own IStream where basically I map the stream to a .NET ...
1
vote
1
answer
111
views
Excel RTD server in a WPF .NET 8 application
Excel RTD is a COM based technology and all examples I found have the following characteristics:
They are based on .NET Framework (not .NET core or modern .NET)
They are 32 bits
They are in process ...
1
vote
1
answer
195
views
Passing an array of objects from C# to VBA Excel
I have a C# console application and Dll. I registered the dll as COM via interop. I used the
COM Visible property, GUID etc
Set Assembly Information, Build information to register it to COM
I ...
1
vote
2
answers
148
views
registering for COM fails because referenced assembly is not registered
I have an assembly containing the following classes that should be exposed to COM:
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
namespace Interop
{
[ComVisible(true)]
[...
2
votes
0
answers
250
views
error: Automation error. The system cannot find the file specified in vb6
I have an application in VB6 and need to create an object of a class that is part of another .dll (written in VB.NET). Now I am using the CreateObject() method (I am following the same logic used in ...
0
votes
1
answer
614
views
Registering a COM Interop DLL > Class not registered
I am familiar with the process of how to register a COM Interop. Eg:
As long as I am running Visual Studio using Administrator elevation this C# COM DLL will compile and register for interop. The TLB ...
0
votes
0
answers
94
views
How to subscribe to the Workbook.SheetActivate event?
I want to subscribe to the Workbook.SheetActivate event of my excel Application which I use as a dynamic object so that I am not dependent on the specific version.
Instantiation and EventHandler:
...
0
votes
0
answers
74
views
How to obtain a COM object type of an array?
Aim: Using reflection and generics pass in a VBA array of custom objects and return the same custom VBA COM object back after processing. Eg in the example removing duplicates from a VBA of any type ...
0
votes
0
answers
70
views
Connect to Running Program via COM - Marshal.GetIUnknownForObject
I am using a software package that offers an "extension" package, largely undocumented, that allows for creation of extensions that allow automation within the program. It's a COM interface ...
0
votes
1
answer
103
views
Cannot Scaffold Access Database after Office365 Upgrade - EFCore + Visual Studio 2019
I've spent the last three hours trying to resolve this issue to no avail, so I'm coming here for some assistance. I have previously scaffolded a subset of this database, but prior that was prior to ...
2
votes
1
answer
655
views
How to use FindAll() with the nuget package Interop.UIAutomationClient
I want to use Microsoft UIAutomation, from C#.
I collected some finds I made on the internet and ended up with the following code (using the Nuget package "Interop.UIAutomationClient" ...
0
votes
1
answer
116
views
CS1545 error with specific COM object properties
I am doing COM automation with a 3rd party library. When trying to access certain properties I need to use obj.get_Property() instead of obj.Property.
This seems to be happening only for properties of ...
1
vote
2
answers
583
views
Get value from System.__Object in C#
I have a vendor specific COM interface. Intellisense shows properties while writing; thus I write something like
App.Element.Car.seats
which is somehow known to Visual Studio. In the autocomplete ...
0
votes
0
answers
76
views
COM interop returns ERROR_FILE_NOT_FOUND
I have a C++ non-managed program calling into a C# DLL using COM interop to access a sharepoint server using SharePoint CSOM.
Calling from C++ returns hr == ERROR_FILE_NOT_FOUND.
Calling the same DLL ...
1
vote
0
answers
77
views
Cannot specify page name when creating a new page using OneNote interop in C#
I am creating a OneNote add-in using OneNote interop in C#. I want to create a page with a specific name, but I'm not able to do so. I used Application.GetHierarchy to get the XML for my notebooks, ...