建立C#与CTP的接口

Discussion in 'CTP' started by LumenXH, Jul 13, 2009.

  1. 是的,跟他的方法的确不同,好像你应该知道的。就是用C++
    做2个托管类(包括.h,.cpp) 调用native c++ 的DLL ,也是生成一个托管的dll .

    在c# 里面只要reference 这个dll ,对C#来说就和使用本地C#的类完全一样了。


    看了一下就跟你在论坛里面收藏的那两个文章的做法差不多,托管类。
    我的程序还有一些bug ,晚上有时间我整理下放上来方法。
     
  2. 谢谢,感觉你这个可能工程量会相对小不少。
     
  3. 昨天晚上,试图完善下这个程序在放上来。由于主力计算机招雷击损坏耽误了不少时间。
    最后发现如果实现原汁原味的API , 工程量的方面一点也不少多少。
     
  4. 3年前的帖子了,没想到现在还会有人发邮件希望我提供代码。
    现在全部代码都已经放到网上了,有需要的朋友直接到这里下载吧~
    https://github.com/LumenXH/CTPFutrueProvider

    此外,这里还有CTP证券版和易胜接口的C#封装:)
     
  5. 十分感谢楼主! 2年前最早用的就是你的C#封装

    刚才试了下,有一下错误 还望帮助

    CTPFutureProvider

    Error 2 error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) Z:\LumenXH\CTPFutureProvider-master\CTPFutureProvider-master\CTPWrapper\libcpmtd.lib(stdthrow.obj) CTPWrapper

    CTPStockProvider

    Error 2 error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) Z:\LumenXH\CTPStockProvider-master\CTPStockProvider-master\CTPStockWrapper\libcpmtd.lib(stdthrow.obj) CTPStockWrapper

    EsunnyProvider

    Error 1 error C2259: 'EsunnyTradeSpi' : cannot instantiate abstract class z:\lumenxh\esunnyprovider-master\esunnyprovider-master\esunnywrapper\src\esunnywrapper.cpp 81 1 EsunnyWrapper

    Error 2 error C2440: 'return' : cannot convert from 'void' to 'int' z:\lumenxh\esunnyprovider-master\esunnyprovider-master\esunnywrapper\src\esunnywrapper.cpp 169 1 EsunnyWrapper
     
  6. 推测应该是运行库方面的问题,建议在vs2010下以win32方式编译,运行库为/MT
     
  7. 请问楼主还有在更新这个代码吗?最新的ctp api是20131205了
     
  8. 做这些体力活有意思吗
     
  9. 我也想问下有没有更新了

    同上
     
  10. 很好。我的邮箱是 bj9595@qq.com 能否发我一份 谢谢