Does the Eikon .Net Desktop API work in non WPF applications?
I get runtime errors when I call DataServices.Instance to retrieve IDataServices instance when I run the application from within a C# console application. Anything other than running it from within a WPF application does NOT work. Why is that the case and can this be remedied? I find using the Eikon Desktop .Net SDK API extremely limiting to run from within a WPF application. Can someone of the developers please comment whether something is missing or why I cannot run the APIs from within a Console Application, for example?
Thank you.
Matt
Best Answer
-
Yes, you can create a C# console application with Eikon .NET Desktop API. The examples are available at https://developers.thomsonreuters.com/eikon-apis/net-apis-use-custom-applications/downloads. You can try Usage Example Realtime Data API.
A console application requires the Windows message pump in order to dispatch the retrieved events.
0
Answers
-
Can you please clarify what you mean with a "Windows message pump" is needed? Can you give concrete example? As it stands I cannot even connect to Eikon from within a Console app.
0 -
Have you tried Usage Example Realtime Data API from https://developers.thomsonreuters.com/eikon-apis/net-apis-use-custom-applications/downloads?
0 -
I did but pushing frames via Dispatcher and more importantly, blocking unless invoking "Frame.Continue" is completely unacceptable and violates most every efficient coding principle.
0 -
A much better way is to use Dispatcher.BeginInvoke() like
Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() =>
{
_dataServices = DataServices.Instance;
_dataServices.StateChanged += DataServicesOnStateChanged;
_dataServices.Initialize("ReutersMarketDataPlugin");
}));But that still is extremely dirty. I was wondering whether another approach exists without having to use the UI thread or any message pumps.
0 -
@jirapongse.phuriphanvichai,
I ran "DataApiUsageExampleTimeseriesData" in your referenced sample library.
How would I have to structure the Message Pump if I wanted to initialize ONCE but request "TimeSeriesRequest();" a second time without having to initialize the whole connection to Eikon again? That does not seem to work. Do I need to create a new DispatcherFrame, then submit a Reuters request, and then push the frame into the pump? Is that what I have to do for every request? And the code blocks on any callbacks from the Reuters API unless I set Frame.Continue to false. Is that correct?
0 -
There is an example available in this question. The example creates a new DispatcherFrame for the new request. However, you can use the same DispatcherFrame by setting Frame.Continue to true and then calling Dispatcher.PushFrame(Frame) again.
0 -
Hi @HFTVOL,
There's no way around having to run Windows message pump. The reason is there's a COM layer underneath .NET assemblies you interact with. And this COM layer cannot dispatch event notifications without Windows message pump running on the same thread. If you don't like using Dispatcher frames, you can instead use System.Windows.Forms.Application.Run method to kick off Windows message pump.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 687 Datastream
- 1.4K DSS
- 622 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 254 ETA
- 557 WebSocket API
- 38 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 276 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 671 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛