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
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛