122 questions
1
vote
0
answers
105
views
How to consume COM events with C# dynamic without COM registration
I can use an out-of-process COM server that is not registered with C# dynamic, and this works fine, but I cannot get events to work.
My code basically is something like this:
Process.Start("path\\...
3
votes
1
answer
68
views
How to get Excel external address of Range object through IDispatch Interface?
The following code returns a list of cell dependent addresses; however I need the dependent addresses to be in External format (include workbook name and worksheet).
I am trying to set the optional ...
1
vote
1
answer
84
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 ...
0
votes
1
answer
122
views
How to get all the interfaces which are supported by the Delphi instance which is accessible from IDispatch?
Motivation: I got IDispatch pointer as a result of my efforts that I have described in my previous question How to access workbooks from the ExcelApplication Delphi COM reference, currently there is ...
2
votes
1
answer
528
views
C# how to implement IDispatch Interface?
I have known that a class like blow will auto implement IDispatch interface:
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class Test
{
}
Now my need is to override the ...
2
votes
1
answer
106
views
Returning an OleVariant from a function causes an extra reference on the contained IDispatch object that cannot be released
I have a function that returns an OleVariant that contains an IDispatch reference counted object:
class function TGrobber.Make: OleVariant;
begin
Result := (TGrobber.Create as IDispatch);
// ...
1
vote
1
answer
907
views
Calling COM from C++ using CoCreateInstance and IDispatch, with numerous parameters in DISPPARAMS incl. SAFEARRAY
I have a COM object which exposes a function. I would like to pass parameters to this function and receive a return value. I'm using C++ with CoCreateInstance(). The error I receive is:
hr = ...
0
votes
0
answers
163
views
C# .Net Framework Class Library proj - Newtonsoft.Json gives "The system cannot find the file specified..." error
The project is a Class Library which I want to use it from a Visual Foxpro application. Visual Foxpro is 32bit.
.Net project:
Target framework .Net Framework 4.7.2
Target Platform x86.
Using ...
0
votes
1
answer
464
views
.NET 6 IDispatch client implementation crash
.NET 6 has trouble calling its own IDispatch objects, if marshaled.
To reproduce:
if (Array.IndexOf(Environment.GetCommandLineArgs(), "/s")>=0) //Server
{
Thread t = new Thread(new ...
2
votes
1
answer
177
views
"Pure" dispinterface marshaling
Update 2021-04-20: The code presented here is for illustration purposes only. As pointed out by Simon Mourier, for marshaling in-process of such a simple class there is no need for all the TLB ...
2
votes
1
answer
167
views
Memory leak using IHTMLEventObj handlers with TWebBrowser
I'm using a TWebBrowser to display a WYSIWYG HTML editor and I've added some handlers to catch keyboard and mouse events so I can integrate this editor into my application flow. This browser is ...
2
votes
1
answer
497
views
How to create a VB.NET COM-visible interface without IDispatch?
If I create a COM-visible VB.NET interface, such as:
<ComVisible(True)>
Public Interface IMyInterface
Sub MyMethod()
End Interface
Then the resulting type library will show IMyInterface ...
1
vote
1
answer
425
views
Dynamic COM object getting asked for unknown interface {B86A98CC-DCC0-3205-8777-7911A07DAAAF} in C#
The QueryInterface() log of an instrumented IDispatch-based COM object accessed in C# via a dynamic variable showed (among others) the unknown IID {B86A98CC-DCC0-3205-8777-7911A07DAAAF}. Google, ...
2
votes
1
answer
543
views
Implement IDispatch Interface for MFC automation
I have a COM project which does not support MFC and needs to communicate with another App through a MFC interface.
I cannot use directly in MFC interface with my COM project as it is not an MFC ...
3
votes
1
answer
771
views
IDispatch Invoke() returns Type mismatch
I'm unable to successfully invoke create_session member. It's return Type mismatch
// COM class -> member
virtual HRESULT __stdcall create_session(
/*[in]*/ BSTR pbszName,
/*[in]*/ ...
1
vote
1
answer
445
views
How do I get a member from an IDispatch interface which is an "array"?
I am a C programmer, but I am new to Windows & COM programming.
For the following C# code:
//Change the font of the selected text in the running PowerPoint.
Application app = Marshal....
0
votes
0
answers
355
views
How to implement IDispatch in c++ COM with multiple interfaces [duplicate]
I have 3 interfaces: IGetInformation, IAccount, ICreateATM and they inherit IDispatch. Also i have class CoATM that inherits these 3 interfaces.
How should I implement IDispatch for all my interfaces ...
1
vote
0
answers
132
views
Why is Application.Run a member of the Excel library whereas CallByName works in general for all VBA?
Excel.Application.Run and VBA.Interaction.CallByName both seem to do similar things; namely calling a method using a string name. As I understand it, this functionality is enabled because VBA is an ...
1
vote
0
answers
168
views
Asynchronous support is not available for IDispatch
Microsoft's documentation states that Asynchronous support is not available for IDispatch or for interfaces that inherit IDispatch ...but I want to do exactly that (to call Excel asynchronously from C+...
0
votes
1
answer
56
views
<Unknown(DispID=0x0000FC95)> (false) fires when updating "HTMLBody"
I have a C# COM Add-in which inserts custom HTML into the body of the email.
Using OutlookSpy, I see the following events have fired:
PropertyChange (To)
PropertyChange (CC)
PropertyChange (BCC)
...
1
vote
1
answer
799
views
Call method using IDispatch in PowerShell
I am trying to communicate with a COM application using PowerShell. When I instantiate it, I can only talk to it through the IDispatch interface. That in itself is interesting, because I can early-...
1
vote
0
answers
312
views
C# COM server returning E_POINTER from GetIDsOfNames
I'm trying to create a COM server in C# to expose an OLE automation object. I'd like to implement the IDispatch interface manually, since I need to do some amount of dynamic lookup for the members. ...
0
votes
1
answer
1k
views
Sage BOI - Error 200 when invoking NewObject on AR_Customer_bus. I'm aiming to create a new customer via the BOI using C#
This is a Sage cloud 2019 Business Object Interface question.
I'm experiencing issues trying to new up an AR_Customer_bus object, my eventual aim is to be able to create a new customer using the BOI. ...
0
votes
2
answers
732
views
In C++, how do you initialize an array of pointers to wchar_t* (resulting in wchar_t**)?
I'm calling a COM function that requires a wchar_t** argument. What I would like to do is:
wchar_t* arr[3] = {L"str1", L"str2", L"str3"};
What I get back is a const wchar_t**, which the compiler ...
0
votes
1
answer
230
views
How to get the method signatures for DShellFolderViewEvents
I'm trying to sink DShellFolderViewEvents using the ATL, and the only method I've been able to successfully subscribe to is DISPID_SELECTIONCHANGED. There appear to be many other events listed in the ...
0
votes
1
answer
566
views
How to declare COM interface with properties in C++
I'm trying to call a registered COM interface (Inproc dll) in an Eclipse C++ environment (MinGW GCC toolchain). I therefore don't believe that I can simply import the dll typelib the way I typically ...
2
votes
0
answers
8k
views
What is causing mscorlib recursive resource lookup bug
The error shown in the following screen shot occurs sporadically:
The application itself is in unmanaged C++, using COM objects, and .NET objects (in C# and VB) via COM interop.
Only two functions ...
0
votes
0
answers
442
views
Delphi - How to implement a custom timeout
I want to implement a custom timeout for my wrapper class.
This code is working but without timeout :/
Let see what I've implemented:
Definition:
TComplusWrapper = class(TObject)
private
...
0
votes
2
answers
308
views
What are the files required for a COM client to connect a COM server (out-of-process scenario)?
I would like to understand the purposes of the files mentioned in this article and link the knowledge to my current COM server and COM client scenario, so that I can implement my COM server to use the ...
-1
votes
2
answers
1k
views
how to convert com instance to variant, to pass it in idispach invoke
i want to pass a com object instance as a variant parameter to another active x object function, for that i need to convert the idispatch pointer to a variant? i am not sure.
hr = CoInitializeEx(...
0
votes
0
answers
632
views
VariantClear releases VT_DISPATCH -vs- MSDN documentation
VS2015 C++ / Windows7 SP1
Considering the following code:
CComPtr<IFontDisp> m_pFont;
::OleCreateFontIndirect(&fdesc,IID_IFontDisp,(void**)&m_pFont);
VARIANT var = m_pFont; // PSEUDO ...
0
votes
1
answer
419
views
Does the `IDispatch::GetTypeInfo()` interface thow?
I'm trying to find information on if the IDispatch interface throws, specifically if IDispatch::GetTypeInfo() does. IIRC, IDispatch::Invoke() can, but I can't seem to find anything on the subject and ...
0
votes
0
answers
109
views
How Define Disparams (component object model)
I want to call an method with invoke. My object input is a string that is address of a file in my computer and type of output is IDispatch. How I should define Disparams as an input of invoke. My ...
6
votes
1
answer
8k
views
information not available, No symbols loaded for .dll
I applied Invoke to use object of an application in C++ but an error occurred.
error:information not available, No symbols loaded for GPNSAutomation.dll
My codes is :
::CLSIDFromProgID(OLESTR("...
2
votes
1
answer
1k
views
COM object late binding using ComInterop in C#
I've a COM object for some simple mathematical utilities. Amongst others, it exports 2 interfaces - the IDL is as follows:
interface IUnivariateFunction : IDispatch
{
HRESULT evaluate([in] double ...
1
vote
1
answer
1k
views
How to manually marshal a .NET object as a dual COM interface?
I have written some C# code which returns a .NET object to unmanaged code as an IDispatch pointer using Marshal.GetIDispatchForObject, however, this object also implements other (non .NET defined) COM ...
0
votes
1
answer
1k
views
How to get a LPDISPATCH pointer/interface and pass it to an activeX Control
I'm using MFC in Visual Studio 2015 on Windows 7 64Bit.
In my application,there is an activeX control,I need to communicate between activeX control and my application.
But activeX need my ...
0
votes
0
answers
1k
views
COM IDispatch->Invoke fails with error DISP_E_EXCEPTION
I'm trying to invoke a IDispatch->Invoke call to get the name of the IDispatch object and the method fails with error DISP_E_EXCEPTION.
The property I'm trying to get is "accName".
Below is the code ...
1
vote
1
answer
996
views
Delphi: Simulating a drag and drop from the clipboard to EmbeddedWB’s IHTMLElement
I have a Delphi XE2 application with a TEmbeddedWB that I use to simulate user actions. The application navigates to a URL, populates the relevant form fields with data and submits the data. The ...
2
votes
1
answer
806
views
OLE bstr not null terminated?
So, I am trying to automate Excel from C++ and OLE, using the Autowrap function provided by Microsoft in their automation examples.
I have gotten as far as that I can read a string value from a cell ...
0
votes
1
answer
239
views
Get User-Defined Methods from IDispatch for Dynamic Assembly
So the program I'm working on creates a dynamic .Net assembly from source code that the user enters into a text editor (using CodeDOM as a compiler). I need to get an IDispatch for this assembly that ...
1
vote
2
answers
196
views
How does a server that expose COM functions via IDispatch can distinct between different clients that Invoke functions without passing any ID param?
I have a Windows Service that is exposing some COM functions to be invoked via IDispatch Invoke. There are different clients (Windows applications) that at any moment can Invoke any of these functions....
1
vote
0
answers
371
views
change interface from IUnknown to IDispatch
I have a COM class which is accessible only via vtable. It is already distributed to clients. I am planning to allow script access as well, by introducing IDispatch.
In my local tests, it shows ...
1
vote
0
answers
2k
views
How to create and pass a COM IDispatch pointer as callback from a C++ Console Client to a C++ WinService successfully?
In advance sorry for the TOO Long post, but given that there are many parts involved, and I am not sure where I can be making a mistake, hence, I need to post all the parts involved. Please do not ...
1
vote
2
answers
638
views
How to invoke an OleAutomation Object method for BSTR*?
Here is the IDispatch interface I got from the type library:
interface IMYPhoneCmd : IDispatch {
[id(0x00000001), helpstring("method CallSet")]
HRESULT CallSet(
[in] BSTR* ...
1
vote
1
answer
623
views
Retrieve DISPID of outgoing dispinterface member
I'm stuck on this one.
Given three variables:
an IDispatch* to a connectable object
the IID (DIID) of an outgoing dispinterface on that object
the name of a member defined by the dispinterface
How ...
2
votes
1
answer
741
views
default property when Com interface type is IDispatch
In a c# com interface, one can define a default member like this
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IMyComClass
{
[DispId(0)] string Item{get;}
}...
0
votes
0
answers
531
views
DLL thread callback works fine but causes access violation when the callback calls InvokeHelper
I have created a DLL that starts up a thread which polls a usb device, when the DLL gets a message from the USB device it calls a callback function.
Using this dll in code consists of creating an ...
2
votes
1
answer
4k
views
How to properly call IDispatch::Invoke with a required BSTR* parameter
There are many examples of how to call IDispatch::Invoke with a BSTR* parameter. I have this working with many other "SomeType*" parameter but no matter what I try, I either get HRESULT of Type ...
2
votes
0
answers
451
views
COM interface created by ATL inherits IDispatch but late binding does not work
This my IDL file. IFrame is a dual interface and inherits both IDispatch and IUnknown.
[
object,
uuid(C5AD0517-37FC-479C-9C7A-A063B17E4A2E),
dual,
nonextensible,
pointer_default(...