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

co-task-mem-alloc Function

Summary

Allocates a block of foreign memory for use in COM method argument passing.

Package

com

Signature

co-task-mem-alloc &key type pointer-type initial-element initial-contents nelems => pointer

Arguments
type
A foreign type.
pointer-type
A foreign pointer type.
initial-element
An object.
initial-contents
A list.
nelems
An integer.
Values
pointer
A pointer to the specified type or pointer-type.
Description

The function co-task-mem-alloc calls the C function CoTaskMemAlloc() to allocate a block of memory.

type, pointer-type, initial-element, initial-contents and nelems are handled in the same way as for the function fli:allocate-foreign-object.

Examples

Two ways to allocate memory for an integer:

(co-task-mem-alloc :type :int)
(co-task-mem-alloc :pointer-type '(:pointer :int))
See also

co-task-mem-free


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