是的,跟他的方法的确不同,好像你应该知道的。就是用C++ 做2个托管类(包括.h,.cpp) 调用native c++ 的DLL ,也是生成一个托管的dll . 在c# 里面只要reference 这个dll ,对C#来说就和使用本地C#的类完全一样了。 看了一下就跟你在论坛里面收藏的那两个文章的做法差不多,托管类。 我的程序还有一些bug ,晚上有时间我整理下放上来方法。
3年前的帖子了,没想到现在还会有人发邮件希望我提供代码。 现在全部代码都已经放到网上了,有需要的朋友直接到这里下载吧~ https://github.com/LumenXH/CTPFutrueProvider 此外,这里还有CTP证券版和易胜接口的C#封装
十分感谢楼主! 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
被筒子们发现future拼错了,我泪奔~~ 地址修改如下: https://github.com/LumenXH/CTPFutureProvider 或者 https://github.com/LumenXH/