Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add CopyComPointer to ctypes doc.
  • Loading branch information
junkmd committed Nov 25, 2024
commit d6cabaa02a2f02c9acfff17fc4a9393c50009e1e
17 changes: 17 additions & 0 deletions Doc/library/ctypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,23 @@ Utility functions
It behaves similar to ``pointer(obj)``, but the construction is a lot faster.


.. function:: CopyComPointer(src, dst)

Copies a COM pointer from *src* to *dst* and returns the Windows specific
:c:type:`!HRESULT` value.

If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the
reference count.

In contrast, even if *dst* is not ``NULL``, its reference count will not be
decremented before assigning the new value. You need to call its ``Release``
to free it appropriately.
Comment thread
picnixz marked this conversation as resolved.
Outdated

.. availability:: Windows

.. versionadded:: next


.. function:: cast(obj, type)

This function is similar to the cast operator in C. It returns a new instance
Expand Down