Following on from your Tutorial 2 (https://developers.refinitiv.com/eikon-com/eikon-desktop-data-api/learning?content=791&type=learning_material_item ) How would I go about unregistering items being streamed and adding new ones?
Working with the example code you provide (https://developers.refinitiv.com/system/files/downloadable/EikonDesktopAPI%20-%20Realtime%20Data%20-%20Tutorials.zip?download_item_nid=9072&destination=node/634/downloads%3Fdownload_item_nid%3D9072)
I modified the main function to become:
static void Main(string[] args)
{
Program p = new Program();
Console.ReadLine()
p.AdxRtList.StopUpdates();
p.AdxRtList.UnregisterAllItems();
p.AdxRtList.RegisterItems("GBP=", "BID");
p.AdxRtList.StartUpdates(RT_RunMode.RT_MODE_ONUPDATE);
}
After the `Console.Readline();` line I get the following Runtime error on the `p.AdxRtList.StopUpdates();` line:
System.InvalidCastException
HResult=0x80004002
Message=Unable to cast COM object of type 'System.__ComObject' to interface type 'ThomsonReuters.Interop.RTX.IAdxRtList'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{057B736E-03DF-11D4-99C8-00105AF7EDAD}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
Source=mscorlib
StackTrace:
at System.StubHelpers.StubHelpers.GetCOMIPFromRCW(Object objSrc, IntPtr pCPCMD, IntPtr& ppTarget, Boolean& pfNeedsRelease)
at ThomsonReuters.Interop.RTX.IAdxRtList.StopUpdates()
at EikonDesktopDataAPITutorial2.Program.Main(String[] args) in *************\Tutorial 2\EikonDesktopDataAPITutorial2\Program.cs:line 56
I am obviously doing something wrong. How are you supposed to do this correctly?
Thanks