evolution-sharp r176 - in branches/EVOLUTION_SHARP_0_16: . evolution/src



Author: jjohnny
Date: Wed Apr 30 11:01:56 2008
New Revision: 176
URL: http://svn.gnome.org/viewvc/evolution-sharp?rev=176&view=rev

Log:
Tell GC not to free. const char*. Fixed Uid & Location properties in e-cal-component.


Modified:
   branches/EVOLUTION_SHARP_0_16/ChangeLog
   branches/EVOLUTION_SHARP_0_16/evolution/src/CalComponent.cs

Modified: branches/EVOLUTION_SHARP_0_16/evolution/src/CalComponent.cs
==============================================================================
--- branches/EVOLUTION_SHARP_0_16/evolution/src/CalComponent.cs	(original)
+++ branches/EVOLUTION_SHARP_0_16/evolution/src/CalComponent.cs	Wed Apr 30 11:01:56 2008
@@ -181,15 +181,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_uid (IntPtr handle, out string uid);
+			static extern void e_cal_component_get_uid (IntPtr handle, out IntPtr uid);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_uid (IntPtr handle, string uid);
 		
 		public string Uid {
 			get {
-				string uid = "";
-				e_cal_component_get_uid (Handle, out uid);
-				return uid;
+				IntPtr uid;
+			    	e_cal_component_get_uid (Handle, out uid);
+			    	string managed_uid = Marshal.PtrToStringAnsi (uid);
+
+			    	return managed_uid;
 			}
 			set {
 				e_cal_component_set_uid (Handle, value);
@@ -271,15 +273,17 @@
 		}
 
 		[DllImport("ecal")]
-			static extern void e_cal_component_get_location (IntPtr raw, out string location);
+			static extern void e_cal_component_get_location (IntPtr raw, out IntPtr location);
 		[DllImport("ecal")]
 			static extern void e_cal_component_set_location (IntPtr raw, string location);
 
 		public string Location {
 			get {
-				string location = "";
+				IntPtr location;
 				e_cal_component_get_location (Handle, out location);
-				return location;
+				string managed_location = Marshal.PtrToStringAnsi (location);
+
+				return managed_location;
 			}
 			set {
 				e_cal_component_set_location (Handle, value);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]