Beispiel #1
0
        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);
        }
Beispiel #2
0
 public nsAString()
     : base(Xpcom.Alloc(new IntPtr(nsStringContainer.Size)))
 {
     NS_StringContainerInit(this.Container);
 }