I'm just started using AAF SDK a month ago to generate an AAF file for my application, everything seems to be working fine until when i try to set rational value in IAAFControlPoint. I get an error "AAFRESULT_ILLEGAL_VALUE" when i try to use SetValue. Below is the example code, i'm not sure whether i use it correctly or not.
Your code looks OK. Unfortunately IAAFControlValue::SetValue is not executed by the unit test so there could be some unknown evil hiding inside. Can you set the control point value via IAAFControlValue::Initialize? It should work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm just started using AAF SDK a month ago to generate an AAF file for my application, everything seems to be working fine until when i try to set rational value in IAAFControlPoint. I get an error "AAFRESULT_ILLEGAL_VALUE" when i try to use SetValue. Below is the example code, i'm not sure whether i use it correctly or not.
aafRational_t p;
p.numerator = 345;
p.denominator = 345;
aafDataBuffer_t val = (aafDataBuffer_t)&p;
aafUInt32 valsize = sizeof(p);
check(pControlPoint->SetValue(valsize, val));
I wish to get the output from InfoDumper as below:
Object of class: ControlPoint
Value: (indirect type: aafRational) (345/345)
Time: ....
EditHint: ......
Your code looks OK. Unfortunately IAAFControlValue::SetValue is not executed by the unit test so there could be some unknown evil hiding inside. Can you set the control point value via IAAFControlValue::Initialize? It should work.
Hi,
Thanks for your reply. I use the IAAFControlPoint::Initialie to set the control point value but now I get an error "AAFRESULT_NO_MORE_OBJECTS".
pControlPoint->Initialize(pVaryingValue, p, valsize, val);
Anything I miss out?
I can't tell without debugging or at least seeing the whole thing. Try looking at at the IAAFControlPoint unit test:
test\com\ComModTestAAF\ModuleTests\CAAFControlPointTest.cpp
and also
test\com\ComModTestAAF\ModuleTests\CAAFVaryingValueTest.cpp
for usage examples.