All Manuals > COM/Automation User Guide and Reference Manual > 2 COM Reference Entries

add-ref Function

Summary

Increments the reference count of a COM interface pointer.

Package

com

Signature

add-ref interface-ptr => ref-count

Arguments
interface-ptr
A COM interface pointer.
Values
ref-count
The new reference count.
Description

Each COM interface pointer has a reference count which is used by the server to control its lifetime. The function add-ref should be called whenever an extra reference to interface-ptr is being made. The function invokes the COM method IUnknown::AddRef so the form (add-ref ptr) is equivalent to using call-com-interface as follows:

(call-com-interface (ptr i-unknown add-ref))
Examples
(add-ref p-foo)
See also

release
interface-ref
query-interface
call-com-interface


COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38