Table of Contents

Constructor SafeComObject

Namespace
PaintDotNet.Interop
Assembly
PaintDotNet.Windows.dll

SafeComObject()

Creates a SafeComObject.

public SafeComObject()

SafeComObject(nint, bool)

Initializes a new instance of the SafeComObject class from the specified COM object, indicating whether to call Release() on the object during the finalization phase.

public SafeComObject(nint pExistingObject, bool ownsHandle)

Parameters

pExistingObject nint
ownsHandle bool

Remarks

This method does not call AddRef() on the object. If ownsHandle is specified as true and the caller wishes to maintain its own reference to the COM object, it should also call the object's AddRef() method.

SafeComObject(void*, bool)

Initializes a new instance of the SafeComObject class from the specified COM object, indicating whether to call Release() on the object during the finalization phase.

public SafeComObject(void* pExistingObject, bool ownsHandle)

Parameters

pExistingObject void*
ownsHandle bool

Remarks

This method does not call AddRef() on the object. If ownsHandle is specified as true and the caller wishes to maintain its own reference to the COM object, it should also call the object's AddRef() method.