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
0 answers

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(unique) ] interface IFrame : IDispatch{ }; [ …
user3707763
  • 121
  • 1
  • 8
2
votes
1 answer

Register events of multiple objects using DispEventAdvise

I have a class that inherits from "DispEventAdvise" (for outlook2010, but its not important): class item_2010_event_handler : public IDispEventSimpleImpl
TCS
  • 5,790
  • 5
  • 54
  • 86
2
votes
2 answers

how to pass c array to javascript from C++

i found some definition in "wtypes.h" VT_PTR = 26, VT_SAFEARRAY = 27, VT_CARRAY = 28, VT_USERDEFINED = 29, VT_LPSTR = 30, VT_LPWSTR = 31, * VT_PTR [T] pointer type * VT_SAFEARRAY [T] (use…
tfzxyinhao
  • 334
  • 5
  • 19
2
votes
0 answers

create ITypeInfo Object without tlb file

I want to create a ITypeInfo Object Without tlb file. class CExternalHelperM:public IDispatch,public IDocHostUIHandler { public: CExternalHelperM(); virtual ~CExternalHelperM(); BEGIN_JSOBJECT_MAP() JSOBJECT_MAP(L"config",CConfigObject) …
tfzxyinhao
  • 334
  • 5
  • 19
2
votes
3 answers

Invoke instanceof operator in JScript in C++ (IDispatch/IDispatchEx)

I have an application that hosts the Active Script JScript engine. Depending on the version of jscript.dll, it runs up to JScript 5.8. The application exposes many objects and methods to the JScript environment. When the script calls a certain…
2
votes
2 answers

How to find the IWebBrowser2 pointer for an IE8 window given a PID?

so far, I've successfully used the following function to retrieve the IWebBrowser2 pointer to a running Internet Explorer instance, given it's PID. static SHDocVw::IWebBrowser2Ptr findBrowserByPID( DWORD pid ) { SHDocVw::IShellWindowsPtr ptr; …
Frerich Raabe
  • 90,689
  • 19
  • 115
  • 207
1
vote
2 answers

Why I am getting same __vfptr for 2 different instances?

I got confused with __vfptr which I see through IDispatch/IUnknown pointers. I'm creating in-proc free threaded COM obj (IMyContainer). Inside this object I need to keep pointers to 2 different instances of com objects which implements same…
adspx5
  • 731
  • 7
  • 16
1
vote
1 answer

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, GitHub and microsoft.com turned up zilch. Does anyone…
DarthGizka
  • 4,347
  • 1
  • 24
  • 36
1
vote
2 answers

Retrieve javascript array object with C++ using DISPID_NEWENUM fails on IE9

following a similar question i answered some time ago, i found out that when trying to enumerate the object, using IDispatch::Invoke(DISPID_NEWENUM,...) fails with DISP_E_EXCEPTION on IE9. This happens with IDispatch and IDispatchEx, on any …
Bagelzone Ha'bonè
  • 1,192
  • 1
  • 14
  • 29
1
vote
1 answer

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 =…
張俊芝
  • 187
  • 1
  • 9
1
vote
0 answers

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 automation language and uses IDispatch for a lot of…
Greedo
  • 4,967
  • 2
  • 30
  • 78
1
vote
1 answer

How to detect PowerPoint 2007 from a C++ addin?

I need to detect if my addin is in PowerPoint 2007 via my C++ addin. The PowerPoint object model exposes Application.Version, which should work, but I do not know enough about how to use this with IDispatch. How to detect PowerPoint 2007 from a C++…
Jason
  • 16,739
  • 23
  • 87
  • 137
1
vote
1 answer

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-bind to it in Visual Studio and talk to it…
Rno
  • 784
  • 1
  • 6
  • 16
1
vote
0 answers

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. When i call my custom GetIDsOfNames the C# method…
Delusional Logic
  • 808
  • 10
  • 32
1
vote
0 answers

Visual Studio IDE Crash Using IDispatch.GetTypeInfo() for Excel.Application

I am writing an application to interface with COM components and I have run into a problem when working with the Excel.Application component while running my application in the Visual Studio 10 IDE. I am getting a fatal Out of Memory error.…
acordner
  • 197
  • 1
  • 3
  • 8