共用方式為


IDataModelManager::GetRootNamespace 方法 (dbgmodel.h)

GetRootNamespace 方法會傳回數據模型的根命名空間。 這是數據模型所管理的物件,偵錯主機在其中放置特定物件。 預期每個主機至少會公開下列階層:

• Debugger - represents the debugger which is hosting the data model

    o Sessions - a collection of sessions which represent each debug target 

         Processes -- a collection of processes which represent each process in the debug target 

            - Threads -- a collection of threads which represent each thread within a given process in the debug target

語法

HRESULT GetRootNamespace(
  IModelObject **rootNamespace
);

參數

rootNamespace

此處會傳回數據模型的根命名空間。

傳回值

這個方法會傳回 HRESULT,指出成功或失敗。

備註

範例程式碼

ComPtr<IDataModelManager> spManager; /* get the data model manager */

ComPtr<IModelObject> spRootNamespace;
if (SUCCEEDED(spManager->GetRootNamespace(&spRootNamespace)))
{
    // We've gotten the root namespace successfully.  Find the Debugger property.
    ComPtr<IModelObject> spDebugger;
    if (SUCCEEDED(spRootNamespace->GetKeyValue(L"Debugger", &spDebugger, nullptr)))
    {
        // We've gotten the "Debugger" property successfully.  Find the 
        // Sessions property.
        ComPtr<IModelObject> spSessions;
        if (SUCCEEDED(spDebugger->GetKeyValue(L"Sessions", &spSessions, nullptr)))
        {
            // We've gotten the "Sessions" property successfully.
        }
    }
}

規格需求

需求
標頭 dbgmodel.h

另請參閱

IDataModelManager 介面