示例#1
0
 public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode)
 {
     throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
 }
示例#2
0
        public void GetComInterfaceForObject_NonGenericCustomQueryInterfaceModeWithValidClass_ReturnsExpected(CustomQueryInterfaceMode mode)
        {
            var    o        = new ClassWithInterface();
            IntPtr iUnknown = Marshal.GetComInterfaceForObject(o, typeof(INonGenericInterface), mode);

            try
            {
                Assert.NotEqual(IntPtr.Zero, iUnknown);
            }
            finally
            {
                Marshal.Release(iUnknown);
            }
        }
示例#3
0
        /// <summary>
        /// Return the IUnknown* representing the interface for the Object.
        /// Object o should support Type T, it refer the value of mode to
        /// invoke customized QueryInterface or not.
        /// </summary>
        public static IntPtr /* IUnknown* */ GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode)
        {
            bool bEnableCustomizedQueryInterface = ((mode == CustomQueryInterfaceMode.Allow) ? true : false);

            return(GetComInterfaceForObjectNative(o, T, false, bEnableCustomizedQueryInterface));
        }
 public static IntPtr GetComInterfaceForObject(Object o, Type T, CustomQueryInterfaceMode mode)
 {
     return(default(IntPtr));
 }
示例#5
0
 public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode);
 public static IntPtr GetComInterfaceForObject(Object o, Type T, CustomQueryInterfaceMode mode)
 {
   return default(IntPtr);
 }