XLL+ Class Library (7.0)

HandleCache<T> Class

Manages object handles in Excel.

class psl::HandleCache<T>

Overview

The HandleCache<T> class holds a set of objects in memory and allows them to be represented in Excel as "handles". It actively manages the lifetime of the cached objects.

Instantiation

If a handle cache of the appropriate type for an object is not found at run-time, then it will be created when required, using the static method HandleCache<T>::GetOrCreateInstance.

However, if you choose to construct a HandleCache<T> object yourself, either as a global object or as a member of your application class, then that instance will be used, and no additional instances will be created.

Handle Format

RTD handles consist of a set of keys, combined to form a handle. The keys include:

Using the default handle format, a handle looks like this:

{A6CBD52A-040D-4990-89EF-41A6721BADC6}:1280298484

The developer can implement their own handle formatting class, and thereby take control of the appearance of the handle, by deriving a class from CHandleFormatter<T>. See CHandleFormatter<T> for more details and an example of a custom formatter.

Requirements

Header: rtdhandles.h
Namespace: psl

See Also

HandleCache<T> Methods | rtdhandles.h