IltmmCapture::SaveSettingsToStream Example for C++

IltmmMemory* pMem;
IStream *pStream = NULL;
LARGE_INTEGER li;
ULARGE_INTEGER liOffset;
li.QuadPart = 0;

CoCreateInstance(CLSID_ltmmMemory, NULL,
   CLSCTX_INPROC_SERVER, IID_IltmmMemory, (void**)&pMem);
pMem->QueryInterface(IID_IStream, (void**)&pStream);
// Get current stream position
pStream->Seek(li, STREAM_SEEK_CUR, &liOffset);
m_capture->SaveSettingsToStream((IUnknown*)pMem, ltmmCapture_Settings_All);

// Seek back
pStream->Seek(liOffset, STREAM_SEEK_SET , NULL);
pStream->Release();
m_capture->LoadSettingsFromStream((IUnknown*)pMem, ltmmCapture_Settings_All);
pMem->Release();