共用方式為


IModelObject::GetNumberOfParentModels 方法 (dbgmodel.h)

GetNumberOfParentModels 方法會傳回附加至指定物件實例的父模型數目。 父模型會在父模型鏈結的線性順序中先搜尋屬性深度。

語法

HRESULT GetNumberOfParentModels(
  ULONG64 *numModels
);

參數

numModels

此處會傳回指定物件的父模型數目。

傳回值

此方法會傳回表示成功或失敗的 HRESULT。

言論

程式代碼範例

ComPtr<IModelObject> spObject; /* get an object */

ULONG64 numModels;
if (SUCCEEDED(spObject->GetNumberOfParentModels(&numModels)))
{
    // numModels contains the number of immediate parent models (does not include 
    // grand-parents and further generations up).  If a key is queried on spObject and 
    // that instance does not have it, the query will be passed in turn to each of the
    // 'numModels' models which are attached to spObject.
}

要求

要求 價值
標頭 dbgmodel.h

另請參閱

IModelObject 介面