2012-02-08 111 views
0

我是彭博API的新手,试图开发我的第一个C#应用程序。Bloomberglp.Blpapi添加参考

我已经安装了blp API。我使用Visual Studio 2008添加了对blpapicomLib COM对象的引用。

我已经定义和这样的别名:

using SessionOptions = blpapicomLib.SessionOptions; 

当我尝试创建这样一个新的SessionOptions:

SessionOptions sessionOptions = new SessionOptions(); 

我收到的错误:

Error 1 Cannot create an instance of the abstract class or interface 'blpapicomLib.SessionOptions' C:\AMSFeederTest\VarPricesLib\VarPricesLib\VarPrices.cs 23 45 VarPricesLib

什么我应该添加到我的项目中的库引用?

回答

1
using Session = Bloomberglp.Blpapi.Session; 
using SessionOptions = Bloomberglp.Blpapi.SessionOptions; 

SessionOptions sessionOptions = new SessionOptions(); 
sessionOptions.ServerHost = serverHost; //localhost 
sessionOptions.ServerPort = serverPort; //8194 

Session session = new Session(sessionOptions); 

... 
...