public IntPtr MarshalManagedToNative(object ManagedObj) { byte [] bytes = Encoding.Unicode.GetBytes(ManagedObj.ToString() + "\0"); IntPtr alloc = Xpcom.Alloc(bytes.Length + 2); Marshal.Copy(bytes, 0, alloc, bytes.Length); return(alloc); }
public nsAString() : base(Xpcom.Alloc(new IntPtr(nsStringContainer.Size))) { NS_StringContainerInit(this.Container); }