IltmmTargetFormat::CreateTargetFormats Example for C++
HRESULT CMainFrame::CreateTargetFormats(IltmmCapture* pCapture)
{
IltmmTargetFormats* pformats = NULL;
IltmmTargetFormat* pformat = NULL;
IUnknown* pDICOMFilter;
VARIANT_BOOL vb;
HRESULT hr = pCapture->get_TargetFormats(&pformats);
if(FAILED(hr))
{
return hr;
}
hr = pformats->Item(ltmmCapture_TargetFormat_DICOM, &pformat);
if(FAILED(hr))
{
pformats->Release();
return hr;
}
pformat->get_UseFilterCache (&vb);
hr = pformat->put_UseFilterCache (VARIANT_TRUE);
if(FAILED(hr))
{
pformat->Release();
pformats->Release();
return hr;
}
/// get the DICOM filter for private use
hr = pformat->GetCacheObject (ltmmTargetFormat_Object_Mux, &pDICOMFilter);
if(FAILED(hr))
{
pformat->Release();
pformats->Release();
return hr;
}
pformat->HasCacheDialog (ltmmTargetFormat_Dlg_Mux, &vb);
if (vb == VARIANT_TRUE)
pformat->ShowCacheDialog (ltmmTargetFormat_Dlg_Mux, (long)m_hWnd);
pformat->Release();
pformats->Release();
pDICOMFilter->Release();
return S_OK;
}