private static void StructAllocString() { MsEmployee employee = new MsEmployee(); employee.EmployeeID = 10001; CPlusPlusLib.GetEmployeeInfo(ref employee); Console.WriteLine("\nemployee Info:"); Console.WriteLine("ID: {0}", employee.EmployeeID); Console.WriteLine("Year:{0}", employee.EmployedYear); Console.WriteLine("Alias: {0}", employee.Alias); Console.WriteLine("Name: {0}", employee.DisplayName); }
public extern static void GetEmployeeInfo(ref MsEmployee MsEmployee_IntPtrString);