IltmmPlay::SaveSettingsToStream Example for C++

void SavePlaySettingsToStream(IltmmPlay *pPlay) 
{ 
   IltmmMemory* pMem; 
   IStream *pStream = NULL; 
   LARGE_INTEGER li; 
   ULARGE_INTEGER liOffset; 
   li.QuadPart = 0; 
 
   // try to create the ltmmMemory object 
   HRESULT hr = CoCreateInstance(CLSID_ltmmMemory, NULL, CLSCTX_INPROC_SERVER, IID_IltmmMemory, (void**)&pMem); 
 
   if (SUCCEEDED(hr)) 
   { 
      // get a stream interface 
      hr = pMem->QueryInterface(IID_IStream, (void**)&pStream); 
 
      if (SUCCEEDED(hr)) 
      { 
         // get current stream position  
         pStream->Seek(li, STREAM_SEEK_CUR, &liOffset); 
         hr = pPlay->SaveSettingsToStream((IUnknown*)pMem, ltmmPlay_Settings_All); 
 
         if (SUCCEEDED(hr)) 
         { 
            // Seek back 
            li.QuadPart = liOffset.QuadPart; 
            pStream->Seek(li, STREAM_SEEK_SET, NULL); 
            pStream->Release(); 
 
            // try to load the saved settings 
            hr = pPlay->LoadSettingsFromStream((IUnknown*)pMem, ltmmPlay_Settings_All); 
            if (SUCCEEDED(hr)) 
            { 
               // everything saved and loaded ok 
            } 
         } 
 
         // release the stream 
         pStream->Release(); 
      } 
 
      // release the ltmmMemory object 
      pMem->Release(); 
   } 
} 
Help Version 22.0.2023.1.26
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Multimedia C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.