public CallResult <string> Query(string account_id, string command, string data) { IntPtr r = TqapiDll.tapi_query(this.handle, account_id, command, data); var cr = Marshal.PtrToStructure <TqapiDll.CallResultWrap>(r); CallResult <string> ret; if (cr.value_type != 0) { ret = new CallResult <string>(Marshal.PtrToStringAuto(cr.value)); } else { ret = new CallResult <string>(cr.msg); } TqapiDll.destroy_callresult(r); return(ret); }