IModelObject::GetParentModel 메서드(dbgmodel.h)
GetParentModel 메서드는 지정된 개체의 부모 모델 체인에서 i번째 부모 모델을 반환합니다. 부모 모델은 추가되거나 열거된 선형 순서로 속성 또는 개념을 검색합니다. 인덱스 i가 0인 부모 모델은 인덱스 i + 1이 있는 부모 모델보다 (계층적으로) 검색됩니다.
구문
HRESULT GetParentModel(
ULONG64 i,
IModelObject **model,
IModelObject **contextObject
);
매개 변수
i
체인에서 검색할 부모 모델을 나타내는 선형 0부터 시작하는 인덱스입니다.
model
i-th 부모 모델을 나타내는 IModelObject 가 여기에 반환됩니다.
contextObject
부모 모델에 연결된 컨텍스트 조정자가 있는 경우 조정된 컨텍스트가 여기에 반환됩니다. 이 값에 대한 자세한 내용은 AddParentModel 설명서를 참조하세요.
반환 값
이 메서드는 성공 또는 실패를 나타내는 HRESULT를 반환합니다.
설명
코드 예제
ComPtr<IModelObject> spObject; /* get an object */
ULONG64 numModels;
if (SUCCEEDED(spObject->GetNumberOfParentModels(&numModels)))
{
// Enumerate the set of parents in linear resolution order:
for (ULONG64 i = 0; i < numModels; ++i)
{
ComPtr<IModelObject> spParent;
ComPtr<IModelObject> spContextAdjustor;
if (SUCCEEDED(spObject->GetParentModel(i, &spParent, &spContextAdjustor)))
{
// spParent contains the i-th parent model
// spContext optionally contains a context adjustor. Properties above
// this in the tree will use this context instead of spObject.
// Conceptually, this is a *this* pointer thunk/adjustor. The
// adjustor can be a property which must be fetched instead of a static value.
}
}
}
요구 사항
| 헤더 | dbgmodel.h |
참고 항목
피드백
다음에 대한 사용자 의견 제출 및 보기