private void InitCallbacks()
        {
            //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
            _fnOnConnect_Holder = OnConnect;
            _fnOnDisconnect_Holder = OnDisconnect;
            _fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction;
            _fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert;
            _fnOnRspError_Holder = OnRspError;
            _fnOnRspOrderAction_Holder = OnRspOrderAction;
            _fnOnRspOrderInsert_Holder = OnRspOrderInsert;
            _fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData;
            _fnOnRspQryInstrument_Holder = OnRspQryInstrument;
            _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
            _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition;
            _fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount;
            _fnOnRtnInstrumentStatus_Holder = OnRtnInstrumentStatus;
            _fnOnRtnDepthMarketData_Holder = OnRtnDepthMarketData;
            _fnOnRtnOrder_Holder = OnRtnOrder;
            _fnOnRtnTrade_Holder = OnRtnTrade;

#if CTP
            _fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
#endif
            
            _fnOnRtnForQuoteRsp_Holder = OnRtnForQuoteRsp;
            _fnOnErrRtnQuoteAction_Holder = OnErrRtnQuoteAction;
            _fnOnErrRtnQuoteInsert_Holder = OnErrRtnQuoteInsert;
            _fnOnRspQuoteAction_Holder = OnRspQuoteAction;
            _fnOnRspQuoteInsert_Holder = OnRspQuoteInsert;
            _fnOnRtnQuote_Holder = OnRtnQuote;
        }
Esempio n. 2
0
        private void InitCallbacks()
        {
            //由于回调函数可能被GC回收,所以用成员变量将回调函数保存下来
            _fnOnConnect_Holder                        = OnConnect;
            _fnOnDisconnect_Holder                     = OnDisconnect;
            _fnOnErrRtnOrderAction_Holder              = OnErrRtnOrderAction;
            _fnOnErrRtnOrderInsert_Holder              = OnErrRtnOrderInsert;
            _fnOnRspError_Holder                       = OnRspError;
            _fnOnRspOrderAction_Holder                 = OnRspOrderAction;
            _fnOnRspOrderInsert_Holder                 = OnRspOrderInsert;
            _fnOnRspQryDepthMarketData_Holder          = OnRspQryDepthMarketData;
            _fnOnRspQryInstrument_Holder               = OnRspQryInstrument;
            _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate;
            _fnOnRspQryInvestorPosition_Holder         = OnRspQryInvestorPosition;
            _fnOnRspQryTradingAccount_Holder           = OnRspQryTradingAccount;
            _fnOnRtnInstrumentStatus_Holder            = OnRtnInstrumentStatus;
            _fnOnRtnDepthMarketData_Holder             = OnRtnDepthMarketData;
            _fnOnRtnOrder_Holder                       = OnRtnOrder;
            _fnOnRtnTrade_Holder                       = OnRtnTrade;

#if CTP
            _fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate;
#endif

            _fnOnRtnForQuoteRsp_Holder    = OnRtnForQuoteRsp;
            _fnOnErrRtnQuoteAction_Holder = OnErrRtnQuoteAction;
            _fnOnErrRtnQuoteInsert_Holder = OnErrRtnQuoteInsert;
            _fnOnRspQuoteAction_Holder    = OnRspQuoteAction;
            _fnOnRspQuoteInsert_Holder    = OnRspQuoteInsert;
            _fnOnRtnQuote_Holder          = OnRtnQuote;
        }
Esempio n. 3
0
 public TraderApiWrapper()
 {
     _fnOnConnect_Holder = OnConnect_callback;
     _fnOnDisconnect_Holder = OnDisconnect_callback;
     _fnOnErrRtnOrderAction_Holder = OnErrRtnOrderAction_callback;
     _fnOnErrRtnOrderInsert_Holder = OnErrRtnOrderInsert_callback;
     _fnOnRspError_Holder = OnRspError_callback;
     _fnOnRspOrderAction_Holder = OnRspOrderAction_callback;
     _fnOnRspOrderInsert_Holder = OnRspOrderInsert_callback;
     _fnOnRspQryDepthMarketData_Holder = OnRspQryDepthMarketData_callback;
     _fnOnRspQryInstrument_Holder = OnRspQryInstrument_callback;
     _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate_callback;
     //_fnOnRspQryInstrumentMarginRate_Holder = OnRspQryInstrumentMarginRate_callback;
     _fnOnRspQryInvestorPosition_Holder = OnRspQryInvestorPosition_callback;
     _fnOnRspQryInvestorPositionDetail_Holder = OnRspQryInvestorPositionDetail_callback;
     _fnOnRspQryOrder_Holder = OnRspQryOrder_callback;
     _fnOnRspQryTrade_Holder = OnRspQryTrade_callback;
     _fnOnRspQryTradingAccount_Holder = OnRspQryTradingAccount_callback;
     _fnOnRtnOrder_Holder = OnRtnOrder_callback;
     _fnOnRtnTrade_Holder = OnRtnTrade_callback;
 }
Esempio n. 4
0
 public TraderApiWrapper()
 {
     _fnOnConnect_Holder                        = OnConnect_callback;
     _fnOnDisconnect_Holder                     = OnDisconnect_callback;
     _fnOnErrRtnOrderAction_Holder              = OnErrRtnOrderAction_callback;
     _fnOnErrRtnOrderInsert_Holder              = OnErrRtnOrderInsert_callback;
     _fnOnRspError_Holder                       = OnRspError_callback;
     _fnOnRspOrderAction_Holder                 = OnRspOrderAction_callback;
     _fnOnRspOrderInsert_Holder                 = OnRspOrderInsert_callback;
     _fnOnRspQryDepthMarketData_Holder          = OnRspQryDepthMarketData_callback;
     _fnOnRspQryInstrument_Holder               = OnRspQryInstrument_callback;
     _fnOnRspQryInstrumentCommissionRate_Holder = OnRspQryInstrumentCommissionRate_callback;
     _fnOnRspQryInstrumentMarginRate_Holder     = OnRspQryInstrumentMarginRate_callback;
     _fnOnRspQryInvestorPosition_Holder         = OnRspQryInvestorPosition_callback;
     _fnOnRspQryInvestorPositionDetail_Holder   = OnRspQryInvestorPositionDetail_callback;
     _fnOnRspQryOrder_Holder                    = OnRspQryOrder_callback;
     _fnOnRspQryTrade_Holder                    = OnRspQryTrade_callback;
     _fnOnRspQryTradingAccount_Holder           = OnRspQryTradingAccount_callback;
     _fnOnRtnInstrumentStatus_Holder            = OnRtnInstrumentStatus_callback;
     _fnOnRtnOrder_Holder                       = OnRtnOrder_callback;
     _fnOnRtnTrade_Holder                       = OnRtnTrade_callback;
 }
Esempio n. 5
0
 public static extern void CTP_RegOnRspQryInstrumentCommissionRate(IntPtr pMsgQueue, fnOnRspQryInstrumentCommissionRate pCallback);
Esempio n. 6
0
 public static extern void CTP_RegOnRspQryInstrumentCommissionRate(IntPtr pMsgQueue, fnOnRspQryInstrumentCommissionRate pCallback);
Esempio n. 7
0
 public static extern void CTP_RegOnRspQryInstrumentCommissionRate(fnOnRspQryInstrumentCommissionRate pCallback);