12,399 questions
0
votes
0
answers
40
views
How to get HRESULT from method invoked by CComDispatchDriver InvokeN?
I am trying to invoke methods from differnt com servers using late binding:
HRESULT hr = drv.InvokeN(dispid, params.data(), static_cast<int>(params.size()), &retVal);
if (!SUCCEEDED(hr)) {......
0
votes
0
answers
19
views
System.Runtime.InteropServices.COMException: Class not registered error for COM component with CLSID {4781DA29-BD5C-11D1-94B1-0000B43369D3} [duplicate]
I'm working on a project targeting .NET Framework 4.8 and encountering an issue related to a COM component used for encryption and decryption. The specific error message is:
System.Runtime....
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 ...
2
votes
1
answer
385
views
Delayed clipboard rendering of multiple files
Working in .NET 8 on Windows (net8.0-windows), I'd like to put several files on the clipboard but only provide the actual data once the user pastes.
This seems straightforward: I subclass DataObject ...
0
votes
1
answer
89
views
C# plugin for AutoCAD has interface members that "aren't implemented" but still builds?
I am trying to make it so I can add properties to the Object Property Manager (OPM) in AutoCAD. I'm following these articles Part 1 Part2
I also forked this project from Github, which follows these ...
1
vote
0
answers
125
views
Can CoUninitialize throw "80070006 The handle is invalid" exception
From the documentation provided by Microsoft, I could not find any note on whether CoUninitialize could raise an exception. This has occurred in random.
Code context: In every thread my exe branches ...
0
votes
1
answer
179
views
Fast reading of each cells color in an Excel sheet
Assume a piece of C# code (running in a process separate from Excel) uses Excel automation to get the used range of a worksheet, something like:
Range usedRange = theWorksheet.UsedRange;
Retrieving ...
0
votes
0
answers
38
views
Registration with Regasm of a library impossible
I'm testing a small dll registered in COM, I use COM because the DLL will be call by a Delphi program. Here is the simple source:
using System;
using System.Collections.Generic;
using System.Linq;
...
0
votes
2
answers
389
views
BSTR Differences between SysAllocString() and BSTR()?
I'm writing a program that takes input from the command-line and uses that input to connect to a remote WMI server and execute methods. My code is as follows:
#define _WIN32_DCOM
#include <comdef.h&...
0
votes
0
answers
42
views
Difference in using a COM object from a DLL vs in an exe for an MFC based app
I have been working on a bit of software which interfaces with an SDK which communicates with a COM object (an external device). This SDK requires an MFC dialog and requires a window handle to work.
...
0
votes
0
answers
68
views
Retrieving the COM class factory for component with CLSID {8E3867A3-8586-11D1-B16A-00C0F0283628} failed
I am working on a project on windows 11 and Visual Studio 22, and I have had to revamp many sub and different functions within the program to get things to work, mainly due to things being outdated ...
2
votes
1
answer
58
views
How to use one PS dataset in a WHERE-OBJECT of another dataset
I have been using PS for about 10 years. Today I am stuck with finding a solution to a problem where I want to have items used in a WHERE-Object loaded from a SQL table. From what I have read, I need ...
-1
votes
1
answer
69
views
Set indexed Property with JACOB fails with 'Member not found'
I have to automate some tasks in XPedition with COM automation using Java and JACOB. When I try to set an indexed property of an object, I receive an error:
com.jacob.com.ComFailException: A COM ...
0
votes
1
answer
773
views
MFC Support in Visual Studio
I have a VC++ 6.0 application that looks rather dated and doesn't build on anything later than Windows 7. I'm worried that MFC will not be supported moving forward as I upgrade to newer versions of ...
1
vote
1
answer
91
views
Debugging assembly to call IUnknown::Release - is shadow space right?
I am getting a bug where sometimes this code works sometimes it does not:
48 8B 41 08 ; MOV RAX, [RCX + 0x08] gets the refcount
48 FF C8 ; DEC RAX ; decrement ...
0
votes
0
answers
63
views
The COM library for checking Windows updates search does not work according to the C++ MFC source code
Environment: Visual Studio 2015, MFC
Issue:
hr = CoInitialize(NULL);
if (FAILED(hr))
{
jvResult[_T("result")] = JsonValue::number((int)ISPT_ResultEnum::ISPTResult_Fail);
jvResult[_T(...
0
votes
0
answers
495
views
CorelDRAW.Application class not registered VBA CorelDRAW
I'm trying to make a program in Excel's VBA editor that interacts with Corel. When I try to run Corel in the COM via this line:
Set cdrApp= CreateObject("CorelDRAW.Application")
I get "...
0
votes
2
answers
143
views
MFC Automation events are working in Excel VBA but not in VBScript
I have created an MFC automation application and also added a source interface (outgoing interface) for events. I can create the COM object and get the event notifications in Excel VBA, but not in ...
0
votes
0
answers
50
views
_variant_t unable to handle long numeric value
I am using ADO in C++ for MSSQL database operations.
One of my tables contains a numeric value. The column is numeric(38,0).
When I try to get the value in _variant_t, it throws an exception (code ...
1
vote
0
answers
103
views
Open MS Access database without COM
I need to open MS Access database in .net8 app, which uses AOT compilation.
AOT compilation has some limitations, like Windows: No built-in COM.
Is there any way to read MS Access in such AOT app ...
1
vote
0
answers
163
views
Shell extension in Explorer run as administrator
I have a shell extension(COM server in a dll adding a new menu item in the context menu) that runs well in Explorer run as a normal user. I want to see if it can run in Explorer run as administrator, ...
0
votes
0
answers
44
views
How to sign a non-VSTO Excel COM add-in written in C#? Should I implement a shim loader or migrate to VSTO?
I developed an Excel add-in using the NetOffice libraries in C#. The add-in is currently loaded by Excel using the default loader (mscoree.dll) and because of this Excel always recognizes it as not ...
0
votes
1
answer
49
views
VSTO Outlook: HOWTO determine if the MailItem comes from a file saved previously in local and then open in Outlook
I have an Outlook VSTO add-in and I need to determine if the Outlook.MailItem being processed corresponds to a saved file on the local disk that has been opened in Outlook, regardless of the type of ...
1
vote
1
answer
55
views
How do I create a COM object with child objects without displaying the base methods, Equals(), GetHashCode(), GetType(), ToString() in Intellisense?
I would like to have my classes exposed without displaying the base methods Equals(), GetHashCode(), GetType(), ToString(). I also want Intellisense to work properly. Here is my sample code:
using ...
1
vote
1
answer
73
views
Can a method be added to an existing dispinterface?
Generally, a method cannot be added to an existing vtable COM interface or dual COM interface, because there may be a derived interface, so expanding the base interface breaks its layout.
But can a ...