Unable to cast COM object of type 'System.__ComObject' to interface type
When I implement the RtGet function by CSharp (by using Interop.EikonDesktopDataAPI and Interop.RTX), I meet an exception "Unable to cast COM object of type 'System.__ComObject' to interface type 'ThomsonReuters.Interop.RTX.IAdxRtList'". What's happened?
public List<RicItem> Get(List<RicItem> ricData)
{
this.ricData = ricData; this.ricData.ForEach(ric => {this.adxRtList.RegisterItems(ric.Ric, ric.Field); });
this.adxRtList.StartUpdates(RT_RunMode.RT_MODE_ONUPDATE); syncMgr.WaitOne();
return this.ricData;
}
Best Answer
-
It is difficult to say without the full code, and it can be more than one issue. However, a good start will be to check if you are accessing and controlling adxRtList from the same thread it was created in. The COM objects should be created in a thread that runs in the single-threaded apartment mode (STA).
On a separate note, is there a reason why you are not using the native .NET Data API? Check out the tutorial.
0
Answers
-
thanks very much!!! we want to make the API synchronized, so we use ManualResetEvent. maybe it's the problem for being multi-thread. for the second question, we want implement not only RtGet but RData & RHistory. the native .NET Data API can only meet the RtGet requirement, so...
0 -
.NET Data API supports real-time and time series, but not the reference data. Also, if you want to use the intraday time series intervals (tick, 1 minute, etc), your only option is .NET.
0 -
On a second thought, are you trying to use it in the console application?
0 -
I have send you a mail with my sample code, I just have the problems in the console application.
0 -
comapiusageexampledexmultithreading.zip
Attached is the sample for the ManualResetEvent in a Console application with EikonDesktopData API. Let me know if this helps!
1 -
I want to make this ACCEPT, thanks!!!
0 -
.NET APIs for use in custom applications
I have seen the sample of reference data, it means the .NET Data API already supports reference data? but I have also checked NuGet, the API is not updated, I'm confused...
0 -
@dirkho not really, as this service provides only symbology conversion functionality.
0 -
Thanks!!! Will the .NET API support reference data in the future?
0 -
We do not have any plans to introduce this functionality.
0 -
thanks. just a little bit disturbing that we have to use both com API and .Net API, anyway, thank you very much~~~
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 中文论坛