Beispiel #1
0
        public void getPlateLocation(int plateIndex, ref LPROCR_lib_PLATE_LOCATION pLocation)
        {
            // Initialize unmanged memory to hold the struct.
            IntPtr pl = Marshal.AllocHGlobal(Marshal.SizeOf(pLocation));

            try
            {
                // Copy the struct to unmanaged memory.
                Marshal.StructureToPtr(pLocation, pl, false);

                LPROCR_lib_getPlateLocation(plateIndex, pl);


                // copy back from unmanaged memory to managed memory
                //
                pLocation = (LPROCR_lib_PLATE_LOCATION)Marshal.PtrToStructure(pl, typeof(LPROCR_lib_PLATE_LOCATION));
            }
            finally
            {
                // Free the unmanaged memory.
                Marshal.FreeHGlobal(pl);
            }
        }
Beispiel #2
0
        public void getPlateLocation(int plateIndex, ref LPROCR_lib_PLATE_LOCATION pLocation)
        {
            // Initialize unmanged memory to hold the struct.
               IntPtr pl = Marshal.AllocHGlobal(Marshal.SizeOf(pLocation));

               try
               {

              // Copy the struct to unmanaged memory.
              Marshal.StructureToPtr(pLocation, pl, false);

              LPROCR_lib_getPlateLocation( plateIndex, pl);

              // copy back from unmanaged memory to managed memory
              //
              pLocation =(LPROCR_lib_PLATE_LOCATION) Marshal.PtrToStructure(pl, typeof(LPROCR_lib_PLATE_LOCATION));

               }
               finally
               {
              // Free the unmanaged memory.
              Marshal.FreeHGlobal(pl);
               }
        }