Error when Creating Dex2Mgr

Hihi, I tried to use the tutorial in the link below but I got the following error at the line in BOLD below.

System.Runtime.InteropServices.COMException: 'Error HRESULT E_FAIL has been returned from a call to a COM component.'

I would appreciate it if anyone can advice how to resolve this? Thanks.

https://developers.thomsonreuters.com/eikon-com/eikon-desktop-data-api/learning?content=804&type=learning_material_item

public void CreateDex2Mgr() {

// Create the Dex2 manager BUT ERROR occurs

MyDex2Mgr = MyEikonDesktopDataAPI.CreateDex2Mgr();

MyDex2MgrADC = (IDex2Mgr2)MyDex2Mgr;

// Initialize the Dex2 manager and retrieve a session cookie

if (MyDex2Mgr != null)

MyDex2Cookie = MyDex2MgrADC.Initialize(DEX2_MetadataCaller.DE_MC_ADC_POWERLINK);

}



Best Answer

  • ccchng
    Answer ✓

    Ok I solved it. This is due to Eikon waiting for connection and not yet connected when the CreateDex2Mgr was called. Thanks.