public override void CopyOut(System.IntPtr from, System.IntPtr to) { __Msg nativeImg = (__Msg)Marshal.PtrToStructure(from, typeof(__Msg)); GCHandle tmpGCHandleTo = GCHandle.FromIntPtr(to); HelloWorldData.Msg toObj = tmpGCHandleTo.Target as HelloWorldData.Msg; CopyOut(ref nativeImg, ref toObj); tmpGCHandleTo.Target = toObj; }
public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, HelloWorldData.Msg from, System.IntPtr to) { __Msg nativeImg = new __Msg(); V_COPYIN_RESULT result = CopyIn(typePtr, from, ref nativeImg); if (result == V_COPYIN_RESULT.OK) { Marshal.StructureToPtr(nativeImg, to, false); } return(result); }
public static void CopyOut(ref __Msg from, ref HelloWorldData.Msg to) { if (to == null) { to = new HelloWorldData.Msg(); } to.userID = from.userID; to.message = ReadString(from.message); to.longitude_ul = from.longitude_ul; to.lattitued_ul = from.lattitued_ul; to.longitude_lr = from.longitude_lr; to.lattitude_lr = from.lattitude_lr; }
public static void StaticCopyOut(System.IntPtr from, ref HelloWorldData.Msg to) { __Msg nativeImg = (__Msg)Marshal.PtrToStructure(from, typeof(__Msg)); CopyOut(ref nativeImg, ref to); }
public V_COPYIN_RESULT CopyIn(System.IntPtr typePtr, HelloWorldData.Msg from, ref __Msg to) { if (from == null) { return(V_COPYIN_RESULT.INVALID); } to.userID = from.userID; if (from.message == null) { return(V_COPYIN_RESULT.INVALID); } // Unbounded string: bounds check not required... if (!Write(c.getBase(typePtr), ref to.message, from.message)) { return(V_COPYIN_RESULT.OUT_OF_MEMORY); } to.longitude_ul = from.longitude_ul; to.lattitued_ul = from.lattitued_ul; to.longitude_lr = from.longitude_lr; to.lattitude_lr = from.lattitude_lr; return(V_COPYIN_RESULT.OK); }