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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document