<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.1.25080.3" />

AgileComPointer<TInterface>

Finalizable wrapper for COM pointers that gives agile access to the specified interface.
public AgileComPointer(TInterface* interface, bool takeOwnership)

public void Dispose()

protected virtual void Dispose(bool disposing)

public ComScope<TInterface> GetInterface()

Gets the default interface. Throws if failed.

public ComScope<TAsInterface> GetInterface<TAsInterface>() where TAsInterface : ValueType modreq(System.Runtime.InteropServices.UnmanagedType), IComIID

Gets the specified interface. Throws if failed.

public object GetManagedObject()

Gets the managed object using the pointer this AgileComPointer<T> was created from.

public bool IsSameNativeObject(AgileComPointer<TInterface> other)

Returns true if other has the same pointer this AgileComPointer<T> was created from.

public bool IsSameNativeObject(TInterface* other)

public ComScope<TInterface> TryGetInterface(out HRESULT hr)

Tries to get the default interface.

public ComScope<TAsInterface> TryGetInterface<TAsInterface>(out HRESULT hr) where TAsInterface : ValueType modreq(System.Runtime.InteropServices.UnmanagedType), IComIID

Tries to get the specified interface.