XLL+ Class Library (6.3)

HandleCache<T>::CreateHandleInCache

Creates a new handle for the supplied pointer, and adds the pointer to the object cache.

std::tstring CreateHandleInCache(
   T* ptr
);
std::tstring CreateHandleInCache(
   RTDHANDLES_PTR_CLASS<T>& sptr
);

Parameters

ptr

A pointer to T. Once a pointer has been passed to CreateHandleInCache, the object pointed to is owned by the HandleCache, and will be deleted when it is no longer in use.

sptr

A smart pointer to T. Once a smart pointer has been passed to CreateHandleInCache, the object pointed to is partially owned by the HandleCache, and will be kept alive until it is no longer in use either by the object cache, or by the library which created the object.

Return Value

Returns the handle for the object, which should immediately be returned to Excel as the result of a handle creator function.

Requirements

Header: rtdhandles.h

See Also

HandleCache<T> Class | HandleCache<T> Methods