本文整理汇总了C++中IRunningObjectTable::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ IRunningObjectTable::Release方法的具体用法?C++ IRunningObjectTable::Release怎么用?C++ IRunningObjectTable::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRunningObjectTable
的用法示例。
在下文中一共展示了IRunningObjectTable::Release方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsExcelThere
BOOL IsExcelThere()
{
IRunningObjectTable *pRot = NULL;
::GetRunningObjectTable(0, &pRot);
IEnumMoniker *pEnum = NULL;
pRot->EnumRunning(&pEnum);
IMoniker* pMon[1] = { NULL };
ULONG fetched = 0;
BOOL found = FALSE;
while (pEnum->Next(1, pMon, &fetched) == 0)
{
IUnknown *pUnknown;
pRot->GetObject(pMon[0], &pUnknown);
IUnknown *pWorkbook;
if (SUCCEEDED(pUnknown->QueryInterface(DIID__Workbook, (void **) &pWorkbook)))
{
found = TRUE;
pWorkbook->Release();
break;
}
pUnknown->Release();
}
if (pRot != NULL)
pRot->Release();
if (pEnum != NULL)
pEnum->Release();
return found;
}
示例2: AddGraphToRot
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister)
{
IMoniker * pMoniker;
IRunningObjectTable *pROT;
if (FAILED(GetRunningObjectTable(0, &pROT)))
{
return E_FAIL;
}
WCHAR wsz[128];
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph,
GetCurrentProcessId());
HRESULT hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr))
{
// Use the ROTFLAGS_REGISTRATIONKEEPSALIVE to ensure a strong reference
// to the object. Using this flag will cause the object to remain
// registered until it is explicitly revoked with the Revoke() method.
//
// Not using this flag means that if GraphEdit remotely connects
// to this graph and then GraphEdit exits, this object registration
// will be deleted, causing future attempts by GraphEdit to fail until
// this application is restarted or until the graph is registered again.
hr = pROT->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE, pUnkGraph,
pMoniker, pdwRegister);
pMoniker->Release();
}
pROT->Release();
return hr;
}
示例3: RemoveFromRot
void RemoveFromRot(DWORD pdwRegister)
{
IRunningObjectTable *pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT))) {
pROT->Revoke(pdwRegister);
pROT->Release();
}
}
示例4: RemoveGraphFromRot
void CDShowControl::RemoveGraphFromRot(DWORD pRegister)
{
IRunningObjectTable *pRot;
if(SUCCEEDED(GetRunningObjectTable(0, &pRot)))
{
pRot->Revoke(pRegister);
pRot->Release();
}
}
示例5: RemoveFromRot
void DirectShowUtil::RemoveFromRot(const DWORD dwRegister)
{
IRunningObjectTable *pROT;
if (SUCCEEDED(::GetRunningObjectTable(0, &pROT))) {
pROT->Revoke(dwRegister);
pROT->Release();
}
}
示例6: RemoveFromObjectTable
void CDXGraph::RemoveFromObjectTable(void)
{
IRunningObjectTable * objectTable = 0;
if (SUCCEEDED(GetRunningObjectTable(0, &objectTable)))
{
objectTable->Revoke(mObjectTableEntry);
objectTable->Release();
mObjectTableEntry = 0;
}
}
示例7: RemoveFGFromROT
//Приватная функция. Удаляет текущий граф из ROT (Running Object Table)
void CDirectShow::RemoveFGFromROT()
{
IRunningObjectTable *pRunningObjectTable = NULL;
if (SUCCEEDED(GetRunningObjectTable(0, &pRunningObjectTable)))
{
pRunningObjectTable->Revoke(m_dwROTRegister);
pRunningObjectTable->Release();
m_dwROTRegister = 0;
}
}
示例8: RemoveFromRot
void CMediaViewer::RemoveFromRot(const DWORD dwRegister) const
{
// デバッグ用
IRunningObjectTable *pROT;
if(SUCCEEDED(::GetRunningObjectTable(0, &pROT))){
pROT->Revoke(dwRegister);
pROT->Release();
}
}
示例9: RemoveGraphFromRot
// Removes a filter graph from the Running Object Table
void __fastcall RemoveGraphFromRot(DWORD dwRegister)
{
IRunningObjectTable *pROT;
if(SUCCEEDED(GetRunningObjectTable(0, &pROT)))
{
pROT->Revoke(dwRegister);
pROT->Release();
}
}
示例10:
// Function name : CVMR9Graph::RemoveFromRot
// Description : remove the graph instance accessibility from graphedit
// Return type : void
void CVMR9Graph::RemoveFromRot()
{
if (m_dwRotId != -1) {
IRunningObjectTable *pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT))) {
pROT->Revoke(m_dwRotId);
m_dwRotId = -1;
pROT->Release();
}
}
}
示例11: AccessVisualStudio
/** Accesses the correct visual studio instance if possible. */
bool AccessVisualStudio(CComPtr<EnvDTE::_DTE>& OutDTE, const FString& InSolutionPath, const TArray<FVSAccessorModule::VisualStudioLocation>& InLocations)
{
bool bSuccess = false;
// Open the Running Object Table (ROT)
IRunningObjectTable* RunningObjectTable;
if (SUCCEEDED(GetRunningObjectTable(0, &RunningObjectTable)) &&
RunningObjectTable)
{
IEnumMoniker* MonikersTable;
RunningObjectTable->EnumRunning(&MonikersTable);
MonikersTable->Reset();
// Look for all visual studio instances in the ROT
IMoniker* CurrentMoniker;
while (!bSuccess && MonikersTable->Next(1, &CurrentMoniker, NULL) == S_OK)
{
IBindCtx* BindContext;
LPOLESTR OutName;
CComPtr<IUnknown> ComObject;
if (SUCCEEDED(CreateBindCtx(0, &BindContext)) &&
SUCCEEDED(CurrentMoniker->GetDisplayName(BindContext, NULL, &OutName)) &&
IsVisualStudioMoniker(FString(OutName), InLocations) &&
SUCCEEDED(RunningObjectTable->GetObject(CurrentMoniker, &ComObject)))
{
CComPtr<EnvDTE::_DTE> TempDTE;
TempDTE = ComObject;
// Get the solution path for this instance
// If it equals the solution we would have opened above in RunVisualStudio(), we'll take that
CComPtr<EnvDTE::_Solution> Solution;
LPOLESTR OutPath;
if (SUCCEEDED(TempDTE->get_Solution(&Solution)) &&
SUCCEEDED(Solution->get_FullName(&OutPath)))
{
FString Filename(OutPath);
FPaths::NormalizeFilename(Filename);
if( Filename == InSolutionPath )
{
OutDTE = TempDTE;
bSuccess = true;
}
}
}
BindContext->Release();
CurrentMoniker->Release();
}
MonikersTable->Release();
RunningObjectTable->Release();
}
return bSuccess;
}
示例12: CreateIFileIsInUse
IFileIsInUse* CreateIFileIsInUse(const string& File)
{
IFileIsInUse *pfiu = nullptr;
IRunningObjectTable *prot;
if (SUCCEEDED(GetRunningObjectTable(0, &prot)))
{
IMoniker *pmkFile;
if (SUCCEEDED(CreateFileMoniker(File.data(), &pmkFile)))
{
IEnumMoniker *penumMk;
if (SUCCEEDED(prot->EnumRunning(&penumMk)))
{
HRESULT hr = E_FAIL;
ULONG celt;
IMoniker *pmk;
while (FAILED(hr) && (penumMk->Next(1, &pmk, &celt) == S_OK))
{
DWORD dwType;
if (SUCCEEDED(pmk->IsSystemMoniker(&dwType)) && dwType == MKSYS_FILEMONIKER)
{
IMoniker *pmkPrefix;
if (SUCCEEDED(pmkFile->CommonPrefixWith(pmk, &pmkPrefix)))
{
if (pmkFile->IsEqual(pmkPrefix) == S_OK)
{
IUnknown *punk;
if (prot->GetObject(pmk, &punk) == S_OK)
{
hr = punk->QueryInterface(
#ifdef __GNUC__
IID_IFileIsInUse, IID_PPV_ARGS_Helper(&pfiu)
#else
IID_PPV_ARGS(&pfiu)
#endif
);
punk->Release();
}
}
pmkPrefix->Release();
}
}
pmk->Release();
}
penumMk->Release();
}
pmkFile->Release();
}
prot->Release();
}
return pfiu;
}
示例13: AddToObjectTable
//////////////////////// For GraphEdit Dubug purpose /////////////////////////////
void CDXGraph::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)mGraph, GetCurrentProcessId());
HRESULT hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr))
{
hr = objectTable->Register(0, mGraph, pMoniker, &mObjectTableEntry);
pMoniker->Release();
}
objectTable->Release();
}
}
示例14: AddGraphToRot
HRESULT AddGraphToRot(IUnknown *pUnkGraph, DWORD *pdwRegister)
{
IMoniker * pMoniker;
IRunningObjectTable *pROT;
if (FAILED(GetRunningObjectTable(0, &pROT))) {
return E_FAIL;
}
WCHAR wsz[128];
wsprintfW(wsz, L"FilterGraph %08x pid %08x", (DWORD_PTR)pUnkGraph, GetCurrentProcessId());
HRESULT hr = CreateItemMoniker(L"!", wsz, &pMoniker);
if (SUCCEEDED(hr)) {
hr = pROT->Register(0, pUnkGraph, pMoniker, pdwRegister);
pMoniker->Release();
}
pROT->Release();
return hr;
}
示例15: AddFGToROT
//Добавляет текущий Filter Graph в ROT (Running Object Table)
//В случае ошибки функция вернет значение меньше нуля
int CDirectShow::AddFGToROT()
{
if (m_pGraphBuilder)
{
IMoniker *pMoniker = NULL;
IRunningObjectTable *pRunningObjectTable = NULL;
if (FAILED(GetRunningObjectTable(0, &pRunningObjectTable)))
{
return -1;
}
WCHAR lpwItem[256] = { 0 };
swprintf(lpwItem, L"FilterGraph %08p pid %08x", (LPDWORD)m_pGraphBuilder, GetCurrentProcessId());
if (FAILED(CreateItemMoniker(L"!", lpwItem, &pMoniker))) return -1;
pRunningObjectTable->Register(0, m_pGraphBuilder, pMoniker, &m_dwROTRegister);
pMoniker->Release();
pRunningObjectTable->Release();
return 0;
}
else return -1;
}