void CMLS_Multimedia::AddToObjectTable(void)
{
IMoniker * pMoniker = 0;
IRunningObjectTable * objectTable = 0;
if(SUCCEEDED((GetRunningObjectTable (0, &objectTable)))
{
WCHAR wsz[256];
wsprintfW(wsz, L"FilterGraph %08p pid %08x", (DWORD_PTR)m_pGraphBuilder, GetCurrentProcessId());
HRESULT hr = CreateItemMoniker (L"!", wsz, &pMoniker);
if(SUCCEEDED(hr))
{
hr = objectTable->Register(0, m_pGraphBuilder, pMoniker, &m_dwObjectTableEntry);
pMoniker->Release();
}
objectTable->Release();
}
}
//=============================================================================
//
void CMLS_Multimedia::RemoveFromObjectTable(void)
{
IRunningObjectTable * objectTable = 0;
if(SUCCEEDED(GetRunningObjectTable (0, &objectTable)))
{
objectTable->Revoke(m_dwObjectTableEntry);
objectTable->Release();
m_dwObjectTableEntry = 0;
}
}