3ds Max C++ API Reference
IUnknownDestructorPolicy Class Reference

Helper class for controlling IStorage and IStream deletion. More...

#include <CustomFileStreamAPI.h>

Public Member Functions

void operator() (IUnknown *pIUnknown)
 

Detailed Description

Helper class for controlling IStorage and IStream deletion.

A typical usage is:

IStorage* pFileIStorage = nullptr;
IStorage* pIStorage = OpenStorageForWrite(fileName, pFileIStorage);
std::unique_ptr<IUnknown, IUnknownDestructorPolicy> pIStorageAutoPtr1(pFileIStorage);
std::unique_ptr<IUnknown, IUnknownDestructorPolicy> pIStorageAutoPtr2(pIStorage);
if (pIStorage == nullptr)
return false;
DllExport IStorage * OpenStorageForWrite(const wchar_t *fileName, IStorage *&pFileIStorage)
Open a file as an OLE structured storage file with read/write access.

Member Function Documentation

◆ operator()()

void operator() ( IUnknown *  pIUnknown)
inline
239  {
240  if (pIUnknown)
241  pIUnknown->Release();
242  }