public readonly int CopyTo <U>(U **ptr)
            where U : unmanaged
        {
            var iid = typeof(U).GUID;

            return(((IUnknown *)(ptr_))->QueryInterface(&iid, (void **)(ptr)));
        }
Example #2
0
 /// <summary>Converts the current COM object reference to a given interface type and assigns that to a target raw pointer.</summary>
 /// <param name="ptr">The target raw pointer to copy the address of the current COM object to.</param>
 /// <returns>The result of <see cref="IUnknown.QueryInterface"/> for the target type <typeparamref name="U"/>.</returns>
 public readonly HRESULT CopyTo <U>(U **ptr)
     where U : unmanaged
 {
     return(((IUnknown *)ptr_)->QueryInterface(__uuidof <U>(), (void **)ptr));
 }