IltmmPlay::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(liOffset, STREAM_SEEK_CUR, &liOffset);

m_player->SaveSettingsToStream((IUnknown*)pMem, ltmmPlay_Settings_All);

// Seek back
pStream->Seek(li, STREAM_SEEK_SET , NULL);
pStream->Release();

m_player->LoadSettingsFromStream((IUnknown*)pMem, ltmmPlay_Settings_All);
pMem->Release();