@@ -51,7 +51,7 @@ public void ReqQrySettlementInfo(string szTradingDay)
5151 Marshal . FreeHGlobal ( szTradingDayPtr ) ;
5252 }
5353
54- public string SendOrder ( int OrderRef , ref OrderField order1 , ref long ret )
54+ public string SendOrder ( int OrderRef , ref OrderField order1 , ref ulong ret )
5555 {
5656 int size = Marshal . SizeOf ( typeof ( OrderField ) ) ;
5757
@@ -60,21 +60,20 @@ public string SendOrder(int OrderRef, ref OrderField order1, ref long ret)
6060 Marshal . StructureToPtr ( order1 , order1Ptr , false ) ;
6161 //Marshal.StructureToPtr(order2, order2Ptr, false);
6262
63- IntPtr ptr = proxy . XRequest ( ( byte ) RequestType . ReqOrderInsert , Handle , IntPtr . Zero ,
63+ ret = proxy . XRequest ( ( byte ) RequestType . ReqOrderInsert , Handle , IntPtr . Zero ,
6464 OrderRef , 0 ,
6565 order1Ptr , size , IntPtr . Zero , 0 , IntPtr . Zero , 0 ) ;
6666
6767 Marshal . FreeHGlobal ( order1Ptr ) ;
6868 //Marshal.FreeHGlobal(order2Ptr);
6969
70- ret = ptr . ToInt64 ( ) ;
7170 if ( ret <= 0 )
7271 return null ;
7372
74- return string . Format ( "{0}:{1}" , UserLoginField . SessionID , ptr ) ;
73+ return string . Format ( "{0}:{1}" , UserLoginField . SessionID , ret ) ;
7574 }
7675
77- public string SendOrder ( int OrderRef , ref OrderField order1 , ref OrderField order2 , ref long ret )
76+ public string SendOrder ( int OrderRef , ref OrderField order1 , ref OrderField order2 , ref ulong ret )
7877 {
7978 int size = Marshal . SizeOf ( typeof ( OrderField ) ) ;
8079
@@ -83,30 +82,29 @@ public string SendOrder(int OrderRef, ref OrderField order1, ref OrderField orde
8382 Marshal . StructureToPtr ( order1 , order1Ptr , false ) ;
8483 Marshal . StructureToPtr ( order2 , order2Ptr , false ) ;
8584
86- IntPtr ptr = proxy . XRequest ( ( byte ) RequestType . ReqOrderInsert , Handle , IntPtr . Zero ,
85+ ret = proxy . XRequest ( ( byte ) RequestType . ReqOrderInsert , Handle , IntPtr . Zero ,
8786 OrderRef , 0 ,
8887 order1Ptr , size , order2Ptr , size , IntPtr . Zero , 0 ) ;
8988
9089 Marshal . FreeHGlobal ( order1Ptr ) ;
9190 Marshal . FreeHGlobal ( order2Ptr ) ;
9291
93- ret = ptr . ToInt64 ( ) ;
9492 if ( ret <= 0 )
9593 return null ;
9694
97- return string . Format ( "{0}:{1}" , UserLoginField . SessionID , ptr ) ;
95+ return string . Format ( "{0}:{1}" , UserLoginField . SessionID , ret ) ;
9896 }
9997
100- public long CancelOrder ( string szId )
98+ public ulong CancelOrder ( string szId )
10199 {
102100 IntPtr szIdPtr = Marshal . StringToHGlobalAnsi ( szId ) ;
103101
104- IntPtr ptr = proxy . XRequest ( ( byte ) RequestType . ReqOrderAction , Handle , IntPtr . Zero , 0 , 0 ,
102+ ulong ret = proxy . XRequest ( ( byte ) RequestType . ReqOrderAction , Handle , IntPtr . Zero , 0 , 0 ,
105103 szIdPtr , 0 , IntPtr . Zero , 0 , IntPtr . Zero , 0 ) ;
106104
107105 Marshal . FreeHGlobal ( szIdPtr ) ;
108106
109- return ptr . ToInt64 ( ) ;
107+ return ret ;
110108 }
111109
112110 public string SendQuote ( ref OrderField order1 , ref OrderField order2 )
@@ -137,7 +135,7 @@ public void CancelQuote(string szId)
137135 Marshal . FreeHGlobal ( szIdPtr ) ;
138136 }
139137
140- protected override IntPtr OnRespone ( byte type , IntPtr pApi1 , IntPtr pApi2 , double double1 , double double2 , IntPtr ptr1 , int size1 , IntPtr ptr2 , int size2 , IntPtr ptr3 , int size3 )
138+ protected override ulong OnRespone ( byte type , IntPtr pApi1 , IntPtr pApi2 , double double1 , double double2 , IntPtr ptr1 , int size1 , IntPtr ptr2 , int size2 , IntPtr ptr3 , int size3 )
141139 {
142140 switch ( ( ResponeType ) type )
143141 {
@@ -160,7 +158,7 @@ protected override IntPtr OnRespone(byte type, IntPtr pApi1, IntPtr pApi2, doubl
160158 break ;
161159 }
162160
163- return IntPtr . Zero ;
161+ return 0 ;
164162 }
165163
166164 private void _OnRspQryInstrument ( IntPtr ptr1 , int size1 , double double1 )
0 commit comments