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();
}
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET