Create a handle, add it to the object cache, and return the handle
template< class T > std::tstring CreateHandleInCache( T* ptr ); template< class T > std::tstring CreateHandleInCache( RTDHANDLES_PTR_CLASS<T>& sptr ); |
A pointer to an instance of type T.
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.
Returns a string handle, which can be displayed in Excel as a value, and which can be passed to functions which accept object handles of type T.
The add-in function that contains the call should be marked as a Handle Creator function. The value returned by this method should usually be returned immediately to Excel, e.g.:
Thing* thing = new Thing(Name, Value, CXlDate::Now()); xloResult = psl::CreateHandleInCache(thing); return xloResult.Ret();
Header: rtdhandles.h