Method in the trading terminal Sterling Code: GetOrderList(VARIANT_BOOL bOpenOnly, SAFEARRAY(structSTIOrderUpdate) *arrayOrder, long *lCount); Such a structure it in Visual Studio Code: int GetOrderList([In] bool bOpenOnly, [MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_EMPTY), In, Out] ref Array arrayOrder); Trying to call it in my application, but I can not understand what I have to do everything to work correctly. code: Code: Array arrList = new Array[10]; var d = stiOrderMaint.GetOrderList(false, ref arrList); Throws an error type of the array is not as expected, try a different The programming language C #. Please help me, how do I call this method. Thank you.
Code: public int OrderCount = new int(); public Array OrderList; public SterlingLib.structSTIOrderUpdate q; public string id; OrderList = Array.CreateInstance((typeof(SterlingLib.structSTIOrderUpdate)), 0); OrderCount = Omaint.GetOptionsOrderList(false, ref OrderList); q = new structSTIOrderUpdate(); for (int i = 0; i < OrderCount; i++) { q = (SterlingLib.structSTIOrderUpdate)OrderList.GetValue(i); id = q.bstrUserId.ToString(); } Hope this helps
Code: public STIEvents events; events = new STIEvents(); events.SetOrderEventsAsStructs(true); Forgot that part.
Omaint = new STIOrderMaint(); ? OrderCount = stiOrderMaint.GetOrderList(false, ref OrderList1); - here the error takes.