question

Upvotes
Accepted
5 1 1 4

Accessing Eikon v4 style fields using DEX2 C++ COM API

I'm trying to access fields TR.CommonName and TR.InstrumentType for VOD.L using the DEX2 C++ example project, but I'm getting an error "The access to field(s) denied". It seems like this is because the example project is not set up to work with Eikon v4-style fields, but I can't figure out how to configure it so that it does. Does anyone have a working C++ example that I can take a look at?

eikoneikon-com-apic++
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
39.2k 75 11 27

Hi @Tristan,

I think you're right. In order to be able to retrieve Eikon v4 style fields you need to implement a trick described in the following document when initializing Dex2Mgr object. I'm afraid the document only provides VB code snippets for reference, but it's quite simple and you shouldn't have any problem translating it into C++.

https://customers.thomsonreuters.com/a/support/paz/pazDocs.aspx?dId=556128

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

@Tristan

The code should look like this:

1. Declare Dex2Lib::IDex2Mgr2

...
CComPtr<Dex2Lib::IDex2Mgr> g_MyDex2Mgr;
CComPtr<Dex2Lib::IDex2Mgr2> g_MyDex2Mgr2;
...

2. Initialize g_MyDex2Mgr2 instead of g_MyDex2Mgr

HRESULT l_hr= g_MyEikonDesktopDataAPI->CreateDex2Mgr((IUnknown **)&g_MyDex2Mgr);
		
g_MyDex2Mgr2 = g_MyDex2Mgr;
...
l_hr = g_MyDex2Mgr2->Initialize(Dex2Lib::DEX2_MetadataCaller::DE_MC_ADC_POWERLINK, l_EmptyVar, &g_MyDex2MgrCookie);

3. Release g_MyDex2Mgr2 instead of g_MyDex2Mgr

g_MyDex2Mgr2.Release();

Please see the attached file (cppeikonnectdlg.zip).

Click below to post an Idea Post Idea