public Int32 HNC_ChannelSetValue(Int32 type, Int32 ch, Int32 index, Int32 value) { Int32 ret = -1; IntPtr ptr = Marshal.AllocHGlobal(HncApi.intSize); Marshal.WriteInt32(ptr, value); ret = HncApi.HNC_ChannelSetValue(type, ch, index, ptr, _ClientNo); Marshal.FreeHGlobal(ptr); return(ret); }