本文介绍了C#中的RTD服务器 - 从哪里开始的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel中有RTD服务器,它从thinkorswim应用程序中提取数据。我想把数据拉到C#中。我有限的编程经验,因此在C#中阅读了有关RTD服务器实现的多个教程,但大多数教程对我而言都是两个。所以我想知道有没有人可以提出一些介绍性的阅读材料。以下是我要实现的示例代码:





我将它复制并粘贴到Visual Studio(VS)中,并称为RtdClient.cs类。 VS立即突出显示以下行:

  ComImport,TypeLibType((short)0x1040)
MarshalAs
MethodImpl

并写入类型和命名空间无法找到。



我没有任何参考?
我在COM类型Tos.RTD中添加了引用,但没有帮助。



同样在注册表中,我找到了Tos.RTD和CLSID的文件夹。我假设CSLID指向COM类型?



在VS Tos.RTD中有几个接口。在上面的链接中,我看不到这些接口的方法的实现。什么是错误?



我还阅读以下我明白第二个链接依赖于反射。这两种方法的优点/缺点是什么?哪一个在概念上更有意义?



你可能看起来我迷失了,所以任何建议将不胜感激。

解决方案

一个RTD服务器是明确的Excel,不会帮助你在C#。你可以反编译,我想,看看它是如何从ThinkOrSwim获取数据的,但是我想象一下,如果你看看更多,你可以使用一个API。


I have RTD server in Excel, which pull data from thinkorswim application. I would like to pull data into C# instead. I have limited programming experience and therefore read multiple tutorials on RTD server implementation in C#, but most of the them are two advanced for me. So I wonder if anybody could suggest some introductory reading materials. Here is sample code that I am trying to implement:

http://awkwardcoder.com/2014/01/24/excel-rtd-client-in-c/

I copied and pasted it into Visual Studio (VS) and called class RtdClient.cs. VS immediately highlighted the following line:

ComImport, TypeLibType((short)0x1040)
MarshalAs
MethodImpl

and wrote the type and namespace could not be found.

Am I missing any references? I added reference on COM type Tos.RTD, but it did not help.

Also in registry I found folder with Tos.RTD and CLSID. I assume that CSLID points to COM type?

In VS Tos.RTD has a couple of interfaces. In the above link, I don't see implementation of the methods of these interfaces. What is wrong?

I also read following RTD through reflection I understand that second link relies on reflection. What are benefits/drawbacks of both approaches? Which one is conceptually more meaningful?

As you can seem I am lost, so any suggestions would be greatly appreciated.

解决方案

An RTD Server is explicitly for Excel and won't help you in C#. You could decompile it I suppose and look to see how it gets it data from ThinkOrSwim, but I would imagine they have an API you could use already if you look around more.

这篇关于C#中的RTD服务器 - 从哪里开始的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 10:45