本文整理汇总了C++中GetRepObject函数的典型用法代码示例。如果您正苦于以下问题:C++ GetRepObject函数的具体用法?C++ GetRepObject怎么用?C++ GetRepObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetRepObject函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFIdentification::SetProductVersion (aafProductVersion_constref version)
{
HRESULT hr;
ImplAAFIdentification * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFIdentification*> (pO);
assert (ptr);
try
{
hr = ptr->SetProductVersion
(version);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
return hr;
}
示例2: GetRepObject
HRESULT STDMETHODCALLTYPE
CEnumAAFLoadedPlugins::Clone (IEnumAAFLoadedPlugins ** ppEnum)
{
HRESULT hr;
ImplEnumAAFLoadedPlugins * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplEnumAAFLoadedPlugins*> (pO);
assert (ptr);
//
// set up for ppEnum
//
ImplEnumAAFLoadedPlugins * internalppEnum = NULL;
ImplEnumAAFLoadedPlugins ** pinternalppEnum = NULL;
if (ppEnum)
{
pinternalppEnum = &internalppEnum;
}
try
{
hr = ptr->Clone
(pinternalppEnum);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// cleanup for ppEnum
//
if (SUCCEEDED(hr))
{
IUnknown *pUnknown;
HRESULT hStat;
if (internalppEnum)
{
pUnknown = static_cast<IUnknown *> (internalppEnum->GetContainer());
hStat = pUnknown->QueryInterface(IID_IEnumAAFLoadedPlugins, (void **)ppEnum);
assert (SUCCEEDED (hStat));
//pUnknown->Release();
internalppEnum->ReleaseReference(); // We are through with this pointer.
}
}
return hr;
}
示例3: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFTypeDefObjectRef::SetObject (IAAFPropertyValue * pPropVal,
IUnknown * pObject)
{
HRESULT hr;
ImplAAFTypeDefObjectRef * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFTypeDefObjectRef*> (pO);
assert (ptr);
//
// set up for pPropVal
//
ImplAAFPropertyValue * internalpPropVal = NULL;
if (pPropVal)
{
HRESULT hStat;
IAAFRoot * iObj;
ImplAAFRoot *arg;
hStat = pPropVal->QueryInterface (IID_IAAFRoot, (void **)&iObj);
assert (SUCCEEDED (hStat));
assert (iObj);
hStat = iObj->GetImplRep((void **)&arg);
assert (SUCCEEDED (hStat));
iObj->Release(); // we are through with this interface pointer.
internalpPropVal = static_cast<ImplAAFPropertyValue*>(arg);
assert (internalpPropVal);
}
//
// set up for pObject
//
ImplAAFRoot * internalpObject = NULL;
if (pObject)
{
HRESULT hStat;
IAAFRoot * iObj;
ImplAAFRoot *arg;
hStat = pObject->QueryInterface (IID_IAAFRoot, (void **)&iObj);
if (FAILED(hStat))
{
// If input IUnknown argument MUST supprt our private IAAFRoot interface.
// If it does not than the argument is not one of our implementation objects!
assert(E_NOINTERFACE == hStat);
if (E_NOINTERFACE == hStat)
return AAFRESULT_INVALID_PARAM;
else
return hStat;
}
assert (iObj);
hStat = iObj->GetImplRep((void **)&arg);
assert (SUCCEEDED (hStat));
iObj->Release(); // we are through with this interface pointer.
internalpObject = static_cast<ImplAAFRoot*>(arg);
assert (internalpObject);
}
try
{
hr = ptr->SetObject
(internalpPropVal,
internalpObject);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// no cleanup necessary for pPropVal
//
//
// no cleanup necessary for pObject
//
//.........这里部分代码省略.........
示例4: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFSelector::RemoveAlternateSegment (IAAFSegment * pSegment)
{
HRESULT hr;
ImplAAFSelector * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFSelector*> (pO);
assert (ptr);
//
// set up for pSegment
//
ImplAAFSegment * internalpSegment = NULL;
if (pSegment)
{
HRESULT hStat;
IAAFRoot * iObj;
ImplAAFRoot *arg;
hStat = pSegment->QueryInterface (IID_IAAFRoot, (void **)&iObj);
assert (SUCCEEDED (hStat));
assert (iObj);
hStat = iObj->GetImplRep((void **)&arg);
assert (SUCCEEDED (hStat));
iObj->Release(); // we are through with this interface pointer.
internalpSegment = static_cast<ImplAAFSegment*>(arg);
assert (internalpSegment);
}
try
{
hr = ptr->RemoveAlternateSegment
(internalpSegment);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// no cleanup necessary for pSegment
//
return hr;
}
示例5: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFSourceClip::SetFade (aafInt32 fadeInLen,
aafFadeType_t fadeInType,
aafInt32 fadeOutLen,
aafFadeType_t fadeOutType)
{
HRESULT hr;
ImplAAFSourceClip * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFSourceClip*> (pO);
assert (ptr);
//
// set up for fadeInType
//
if (! Is_aafFadeType_t_Valid(fadeInType))
return AAFRESULT_INVALID_ENUM_VALUE;
//
// set up for fadeOutType
//
if (! Is_aafFadeType_t_Valid(fadeOutType))
return AAFRESULT_INVALID_ENUM_VALUE;
try
{
hr = ptr->SetFade
(fadeInLen,
fadeInType,
fadeOutLen,
fadeOutType);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
return hr;
}
示例6: GetRepObject
HRESULT STDMETHODCALLTYPE
CEnumAAFFileDescriptors::Next (aafUInt32 count,
IAAFFileDescriptor ** ppFileDescriptors,
aafUInt32 * pNumFetched)
{
HRESULT hr;
ImplEnumAAFFileDescriptors * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplEnumAAFFileDescriptors*> (pO);
assert (ptr);
//
// set up for ppFileDescriptors
//
ImplAAFFileDescriptor ** internalppFileDescriptors = NULL;
assert (count >= 0);
internalppFileDescriptors = new ImplAAFFileDescriptor*[count];
assert (internalppFileDescriptors);
ImplAAFFileDescriptor ** pinternalppFileDescriptors = NULL;
if (ppFileDescriptors)
{
pinternalppFileDescriptors = internalppFileDescriptors;
}
try
{
hr = ptr->Next
(count,
pinternalppFileDescriptors,
pNumFetched);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// cleanup for ppFileDescriptors
//
if (SUCCEEDED(hr)||hr==AAFRESULT_NO_MORE_OBJECTS)
{
IUnknown *pUnknown;
HRESULT hStat;
aafUInt32 localIdx;
assert (count >= 0);
for (localIdx = 0; localIdx < *pNumFetched; localIdx++)
{
pUnknown = static_cast<IUnknown *> (internalppFileDescriptors[localIdx]->GetContainer());
hStat = pUnknown->QueryInterface(IID_IAAFFileDescriptor, (void **)(ppFileDescriptors+localIdx));
assert (SUCCEEDED (hStat));
//pUnknown->Release();
internalppFileDescriptors[localIdx]->ReleaseReference(); // We are through with this pointer.
}
}
delete[] internalppFileDescriptors;
internalppFileDescriptors = 0;
return hr;
}
示例7: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFTypeDefRecord::Initialize (aafUID_constref id,
IAAFTypeDef ** ppMemberTypes,
aafString_t * pMemberNames,
aafUInt32 numMembers,
aafCharacter_constptr pTypeName)
{
HRESULT hr;
ImplAAFTypeDefRecord * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFTypeDefRecord*> (pO);
assert (ptr);
//
// set up for ppMemberTypes
//
ImplAAFTypeDef ** internalppMemberTypes = NULL;
if (ppMemberTypes)
{
aafUInt32 localIdx;
assert (numMembers >= 0);
internalppMemberTypes = new ImplAAFTypeDef*[numMembers];
assert (internalppMemberTypes);
for (localIdx = 0; localIdx < numMembers; localIdx++)
{
HRESULT hStat;
IAAFRoot * iObj;
ImplAAFRoot *arg;
hStat = ppMemberTypes[localIdx]->QueryInterface (IID_IAAFRoot, (void **)&iObj);
assert (SUCCEEDED (hStat));
assert (iObj);
hStat = iObj->GetImplRep((void **)&arg);
assert (SUCCEEDED (hStat));
iObj->Release(); // we are through with this interface pointer.
internalppMemberTypes[localIdx] = static_cast<ImplAAFTypeDef*>(arg);
assert (internalppMemberTypes[localIdx]);
}
}
try
{
hr = ptr->Initialize
(id,
internalppMemberTypes,
const_cast<aafCharacter_constptr*>(pMemberNames),
numMembers,
pTypeName);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// cleanup for ppMemberTypes
//
if (internalppMemberTypes)
{
delete[] internalppMemberTypes;
internalppMemberTypes = 0;
}
return hr;
}
示例8: GetRepObject
HRESULT STDMETHODCALLTYPE
CAAFClassDef::RegisterNewPropertyDef (aafUID_constref id,
aafCharacter_constptr pName,
IAAFTypeDef * pTypeDef,
aafBoolean_t isOptional,
aafBoolean_t isUniqueIdentifier,
IAAFPropertyDef ** ppPropDef)
{
HRESULT hr;
ImplAAFClassDef * ptr;
ImplAAFRoot * pO;
pO = GetRepObject ();
assert (pO);
ptr = static_cast<ImplAAFClassDef*> (pO);
assert (ptr);
//
// set up for pTypeDef
//
ImplAAFTypeDef * internalpTypeDef = NULL;
if (pTypeDef)
{
HRESULT hStat;
IAAFRoot * iObj;
ImplAAFRoot *arg;
hStat = pTypeDef->QueryInterface (IID_IAAFRoot, (void **)&iObj);
assert (SUCCEEDED (hStat));
assert (iObj);
hStat = iObj->GetImplRep((void **)&arg);
assert (SUCCEEDED (hStat));
iObj->Release(); // we are through with this interface pointer.
internalpTypeDef = static_cast<ImplAAFTypeDef*>(arg);
assert (internalpTypeDef);
}
//
// set up for isOptional
//
if (! Is_aafBoolean_t_Valid(isOptional))
return AAFRESULT_INVALID_ENUM_VALUE;
//
// set up for isUniqueIdentifier
//
if (! Is_aafBoolean_t_Valid(isUniqueIdentifier))
return AAFRESULT_INVALID_ENUM_VALUE;
//
// set up for ppPropDef
//
ImplAAFPropertyDef * internalppPropDef = NULL;
ImplAAFPropertyDef ** pinternalppPropDef = NULL;
if (ppPropDef)
{
pinternalppPropDef = &internalppPropDef;
}
try
{
hr = ptr->RegisterNewPropertyDef
(id,
pName,
internalpTypeDef,
isOptional,
isUniqueIdentifier,
pinternalppPropDef);
}
catch (OMException& e)
{
// OMExceptions should be handled by the impl code. However, if an
// unhandled OMException occurs, control reaches here. We must not
// allow the unhandled exception to reach the client code, so we
// turn it into a failure status code.
//
// If the OMException contains an HRESULT, it is returned to the
// client, if not, AAFRESULT_UHANDLED_EXCEPTION is returned.
//
hr = OMExceptionToResult(e, AAFRESULT_UNHANDLED_EXCEPTION);
}
catch (OMAssertionViolation &)
{
// Control reaches here if there is a programming error in the
// impl code that was detected by an assertion violation.
// We must not allow the assertion to reach the client code so
// here we turn it into a failure status code.
//
hr = AAFRESULT_ASSERTION_VIOLATION;
}
catch (...)
{
// We CANNOT throw an exception out of a COM interface method!
// Return a reasonable exception code.
//
hr = AAFRESULT_UNEXPECTED_EXCEPTION;
}
//
// no cleanup necessary for pTypeDef
//
//
// cleanup for ppPropDef
//
//.........这里部分代码省略.........