Questions tagged [idispatch]

The IDispatch interface exposes objects, methods and properties to programming tools and other applications that support Automation.

IDispatch Interface

Exposes objects, methods and properties to programming tools and other applications that support Automation. COM components implement the IDispatch interface to enable access by Automation clients, such as Visual Basic.

The IDispatch interface was initially designed to support Automation. It provides a late-binding mechanism to access and retrieve information about an object's methods and properties. Previously, server developers had to implement both the IDispatch and IAccessible interfaces for their accessible objects; that is, they had to provide a dual interface. With Microsoft Active Accessibility 2.0, servers can return E_NOTIMPL from IDispatch methods and Microsoft Active Accessibility will implement the IAccessible interface for them.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms221608(v=vs.85).aspx

120 questions
2
votes
1 answer

Communicating with ActiveX with a GCC compiler

How do I reference and communciate with an ActiveX library from within my gcc compiled application?
Jason
  • 16,739
  • 23
  • 87
  • 137
2
votes
1 answer

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 Invoke function, how can I do this? Supplement: I…
yunate
  • 59
  • 3
2
votes
1 answer

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); // Reference count of IDispatch inside Result at this…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
2
votes
1 answer

"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 shenanigans. In reality, the TLB is provided by a…
Michael Bikovitsky
  • 903
  • 2
  • 10
  • 20
2
votes
1 answer

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 integrated in a custom TPanel, TPanelEditorHTML. This…
Héctor C.
  • 433
  • 4
  • 17
2
votes
1 answer

How to create a VB.NET COM-visible interface without IDispatch?

If I create a COM-visible VB.NET interface, such as: Public Interface IMyInterface Sub MyMethod() End Interface Then the resulting type library will show IMyInterface inheriting IDispatch. Is there a way to inherit just…
tenfour
  • 36,141
  • 15
  • 83
  • 142
2
votes
1 answer

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 project. A solution was to create an automation…
firehelm
  • 49
  • 5
2
votes
1 answer

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 a, [out, retval] double* b); }; interface…
DaveM
  • 205
  • 1
  • 9
2
votes
1 answer

passing a struct to a IDispatch method

In a third party COM Module I have to pass a struct to a Method. The important parts of the IDL definition look like this: interface ITheirInterface : IDispatch { [id(0x0000012d)] HRESULT TheirMethod([in] TheirStruct Attributes); }; struct…
Jan
  • 641
  • 1
  • 6
  • 22
2
votes
4 answers

Getting an access to member of IDispatch interface

I am a physicist. I am trying to work on Delphi with an imported activex control (ocx file). Let’s say there are 3 automation interfaces in the library: IGraph, IGraphAxes and IAxis. The structure of the library is such that: ===IGraph’s…
goldie
  • 21
  • 1
  • 3
2
votes
1 answer

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 in the spreadsheet. However, it seems like for…
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173
2
votes
1 answer

Esoteric JScript hosting problem: where is the error code when IDispatch::Invoke returns SCRIPT_E_PROPAGATE?

Our application hosts the Windows Scripting Host JScript engine and exposes several domain objects that can be called from script code. One of the domain objects is a COM component that implements IDispatch (actually, IDispatchEx) and which has a…
James Hugard
  • 3,232
  • 1
  • 25
  • 36
2
votes
2 answers

patching approach for asp.net site

I'm working on a new project that is in .net 3.5. Currently the client is using stored procs and we would really like to use LINQ to SQL instead. The main reason they use stored procs is because they believe they are easier to update and such, they…
Daniel
  • 21
  • 1
2
votes
1 answer

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;} } with IDispatch (or dual) everything works as…
ekt
  • 129
  • 2
  • 11
2
votes
1 answer

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 Mismatch, E_OUTOFMEMORY or an access violation. It…
user3739214
  • 81
  • 1
  • 6