IltmmCapture::get_WMProfile Example for C++
// This function displays the currently associated WM
// Profile for the specified capture object
void DisplaySelectedProfileName(IltmmCapture *pCapture)
{
USES_CONVERSION;
IltmmWMProfile *pCurrentProfile = NULL;
BSTR bstrStringName;
HRESULT hr;
hr = pCapture->get_WMProfile (&pCurrentProfile);
if(FAILED(hr))
{
return;
}
if(pCurrentProfile)
{
hr = pCurrentProfile->get_Name (&bstrStringName);
if(FAILED(hr))
{
pCurrentProfile->Release();
return;
}
MessageBox(NULL, OLE2A(bstrStringName),
"Profile selected",
MB_ICONINFORMATION);
pCurrentProfile->Release();
}
else
{
MessageBox(NULL, "There is no profile currently selected",
"Profile selected",
MB_ICONINFORMATION);
}
}