本文整理汇总了C++中GetRunningObjectTable函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRunningObjectTable函数的具体用法?C++ GetRunningObjectTable怎么用?C++ GetRunningObjectTable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetRunningObjectTable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IHlinkBC_Register
static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
{
static const WCHAR szIdent[] = {'W','I','N','E','H','L','I','N','K',0};
HlinkBCImpl *This = impl_from_IHlinkBrowseContext(iface);
IMoniker *mon;
IMoniker *composite;
IRunningObjectTable *ROT;
HRESULT hr;
FIXME("(%p)->(%i %p %p %p)\n", This, dwReserved, piunk, pimk, pdwRegister);
hr = CreateItemMoniker(NULL, szIdent, &mon);
if (FAILED(hr))
return hr;
CreateGenericComposite(mon, pimk, &composite);
GetRunningObjectTable(0, &ROT);
IRunningObjectTable_Register(ROT, 0, piunk, composite, pdwRegister);
IRunningObjectTable_Release(ROT);
IMoniker_Release(composite);
IMoniker_Release(mon);
return S_OK;
}
示例2: RegisterActiveObject
/***********************************************************************
* RegisterActiveObject (OLEAUT32.33)
*
* Registers an object in the global item table.
*
* PARAMS
* punk [I] Object to register.
* rcid [I] CLSID of the object.
* dwFlags [I] Flags.
* pdwRegister [O] Address to store cookie of object registration in.
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*/
HRESULT WINAPI RegisterActiveObject(
LPUNKNOWN punk,REFCLSID rcid,DWORD dwFlags,LPDWORD pdwRegister
) {
WCHAR guidbuf[80];
HRESULT ret;
LPRUNNINGOBJECTTABLE runobtable;
LPMONIKER moniker;
DWORD rot_flags = ROTFLAGS_REGISTRATIONKEEPSALIVE; /* default registration is strong */
StringFromGUID2(rcid,guidbuf,39);
ret = CreateItemMoniker(pdelimiter,guidbuf,&moniker);
if (FAILED(ret))
return ret;
ret = GetRunningObjectTable(0,&runobtable);
if (FAILED(ret)) {
IMoniker_Release(moniker);
return ret;
}
if(dwFlags == ACTIVEOBJECT_WEAK)
rot_flags = 0;
ret = IRunningObjectTable_Register(runobtable,rot_flags,punk,moniker,pdwRegister);
IRunningObjectTable_Release(runobtable);
IMoniker_Release(moniker);
return ret;
}
示例3: RevokeObjectRegistration
static void
RevokeObjectRegistration(
RegisteredInterp *riPtr)
{
LPRUNNINGOBJECTTABLE pROT = NULL;
HRESULT hr = S_OK;
if (riPtr->cookie != 0) {
hr = GetRunningObjectTable(0, &pROT);
if (SUCCEEDED(hr)) {
hr = pROT->lpVtbl->Revoke(pROT, riPtr->cookie);
pROT->lpVtbl->Release(pROT);
riPtr->cookie = 0;
}
}
/*
* Release the name storage.
*/
if (riPtr->name != NULL) {
free(riPtr->name);
riPtr->name = NULL;
}
}
示例4: 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;
}
示例5: AddGraphToRunningObjectTable
HRESULT
AddGraphToRunningObjectTable(IUnknown *aUnkGraph, DWORD *aOutRotRegister)
{
HRESULT hr;
nsRefPtr<IMoniker> moniker;
nsRefPtr<IRunningObjectTable> runningObjectTable;
hr = GetRunningObjectTable(0, getter_AddRefs(runningObjectTable));
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
const size_t STRING_LENGTH = 256;
WCHAR wsz[STRING_LENGTH];
StringCchPrintfW(wsz,
STRING_LENGTH,
L"FilterGraph %08x pid %08x",
(DWORD_PTR)aUnkGraph,
GetCurrentProcessId());
hr = CreateItemMoniker(L"!", wsz, getter_AddRefs(moniker));
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
hr = runningObjectTable->Register(ROTFLAGS_REGISTRATIONKEEPSALIVE,
aUnkGraph,
moniker,
aOutRotRegister);
NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
return S_OK;
}
示例6: RemoveGraphFromRot
// Removes a filter graph from the Running Object Table
void CTsReaderFilter::RemoveGraphFromRot()
{
if (m_dwGraphRegister==0) return;
CComPtr <IRunningObjectTable> pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT)))
pROT->Revoke(m_dwGraphRegister);
}
示例7: RemoveFromRot
void RemoveFromRot(DWORD pdwRegister)
{
IRunningObjectTable *pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT))) {
pROT->Revoke(pdwRegister);
pROT->Release();
}
}
示例8: RemoveGraphFromRunningObjectTable
void
RemoveGraphFromRunningObjectTable(DWORD aRotRegister)
{
nsRefPtr<IRunningObjectTable> runningObjectTable;
if (SUCCEEDED(GetRunningObjectTable(0, getter_AddRefs(runningObjectTable)))) {
runningObjectTable->Revoke(aRotRegister);
}
}
示例9: RemoveGraphFromRot
//-----------------------------------------------------------------------------
// RemoveGraphFromRot
// Removes a filter graph from the Running Object Table
void CDSUtils::RemoveGraphFromRot(DWORD pdwRegister)
{
CComPtr<IRunningObjectTable> pROT = NULL;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT)))
{
pROT->Revoke(pdwRegister);
}
}
示例10: RemoveGraphFromRot
void CDShowControl::RemoveGraphFromRot(DWORD pRegister)
{
IRunningObjectTable *pRot;
if(SUCCEEDED(GetRunningObjectTable(0, &pRot)))
{
pRot->Revoke(pRegister);
pRot->Release();
}
}
示例11: RegisterInterp
static HRESULT
RegisterInterp(
const char *name,
RegisteredInterp *riPtr)
{
HRESULT hr = S_OK;
LPRUNNINGOBJECTTABLE pROT = NULL;
LPMONIKER pmk = NULL;
int i, offset;
const char *actualName = name;
Tcl_DString dString;
Tcl_DStringInit(&dString);
hr = GetRunningObjectTable(0, &pROT);
if (SUCCEEDED(hr)) {
offset = 0;
for (i = 1; SUCCEEDED(hr); i++) {
if (i > 1) {
if (i == 2) {
Tcl_DStringInit(&dString);
Tcl_DStringAppend(&dString, name, -1);
Tcl_DStringAppend(&dString, " #", 2);
offset = Tcl_DStringLength(&dString);
Tcl_DStringSetLength(&dString, offset+TCL_INTEGER_SPACE);
actualName = Tcl_DStringValue(&dString);
}
sprintf(Tcl_DStringValue(&dString) + offset, "%d", i);
}
hr = BuildMoniker(actualName, &pmk);
if (SUCCEEDED(hr)) {
hr = pROT->lpVtbl->Register(pROT,
ROTFLAGS_REGISTRATIONKEEPSALIVE,
riPtr->obj, pmk, &riPtr->cookie);
pmk->lpVtbl->Release(pmk);
}
if (hr == MK_S_MONIKERALREADYREGISTERED) {
pROT->lpVtbl->Revoke(pROT, riPtr->cookie);
} else if (hr == S_OK) {
break;
}
}
pROT->lpVtbl->Release(pROT);
}
if (SUCCEEDED(hr)) {
riPtr->name = strdup(actualName);
}
Tcl_DStringFree(&dString);
return hr;
}
示例12: RemoveGraphFromRot
// Removes a filter graph from the Running Object Table
void CBDAFilterGraph::RemoveGraphFromRot(
DWORD pdwRegister
)
{
CComPtr <IRunningObjectTable> pROT;
if (SUCCEEDED(GetRunningObjectTable(0, &pROT)))
pROT->Revoke(pdwRegister);
}
示例13: 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();
}
}
示例14: 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;
}
}
示例15: RemoveFromObjectTable
void CDXGraph::RemoveFromObjectTable(void)
{
IRunningObjectTable * objectTable = 0;
if (SUCCEEDED(GetRunningObjectTable(0, &objectTable)))
{
objectTable->Revoke(mObjectTableEntry);
objectTable->Release();
mObjectTableEntry = 0;
}
}