public CallResult <OrderID> PlaceOrder(string account_id, string code, double price, long size, string action, string price_type, int order_id) { IntPtr r = TqapiDll.tapi_place_order(this.handle, account_id, code, price, size, action, price_type, order_id); var cr = Marshal.PtrToStructure <TqapiDll.CallResultWrap>(r); CallResult <OrderID> ret; if (cr.value_type != 0) { ret = new CallResult <OrderID>(Marshal.PtrToStructure <OrderID>(cr.value)); } else { ret = new CallResult <OrderID>(cr.msg); } TqapiDll.destroy_callresult(r); return(ret); }