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

interface-ref Accessor

Summary

Accesses a place containing an interface pointer, maintaining reference counts.

Package

com

Signature

interface-ref iptr-place => iptr

setf (interface-ref iptr-place) iptr => iptr

Arguments
iptr-place
A place containing a COM interface pointer or nil.
iptr
A COM interface pointer or nil.
Values
iptr
A COM interface pointer or nil.
Description

The accessor interface-ref is useful when manipulating a place containing an interface pointer.

The setf form increments the reference count, as if by add-ref, of iptr, unless it is nil. It then decrements the reference count, as if by release, of the existing value in iptr-place, unless this is nil. Note that this order is important in the case that the new value is the same as the current value. Finally the value of place iptr-place is set to iptr.

The reader interface-ref simply returns the interface pointer stored in iptr-place and does no reference counting. It may be useful in a form which both reads and writes a place like incf.

See also

add-ref
release


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