Hi,
I have oneqestion, maybe someone can help me.
Is there any difference of using between MFVec3f.Add and
MFColor.Add Method. Of course the values for RGB
colors must be in the range [0, 1]. For MFColor.Add I do
almost the same as for MFVec3f.Add but the blue color is
always 0.
Thanks a lot!
Stoyan
And this is my code here.
Any suggestions why it does not work are appreciate!!!
// Create the safe array
const int iCount = 3;
SAFEARRAYBOUND sSABound[1];
SAFEARRAY *pSA;
sSABound[0].cElements = iCount;
sSABound[0].lLbound = 0;
pSA = SafeArrayCreate(VT_VARIANT, 1,
sSABound);
// Gain access to the values
VARIANT *pVal = NULL;
HRESULT hResult = SafeArrayAccessData
(pSA, (void**)&pVal);
if (SUCCEEDED(hResult)) {
// Populate the array
VariantInit(pVal);
pVal[0].vt = VT_R4;
pVal[0].fltVal = 1.;
VariantInit(pVal + 1);
pVal[1].vt = VT_R4;
pVal[1].fltVal = 1.;
VariantInit(pVal + 2);
pVal[2].vt = VT_R4;
pVal[2].fltVal = 1;
SafeArrayUnaccessData(pSA);
}
else {
SafeArrayDestroy(pSA);
//return false;
}
// Initialise the variant
VARIANT sVarArray;
VariantInit(&sVarArray);
// Set the type and value
sVarArray.vt = VT_ARRAY | VT_VARIANT;
sVarArray.parray = pSA;
// Set the optional before param
VARIANT sVarBefore;
VariantInit(&sVarBefore);
sVarBefore.vt = VT_ERROR;
sVarBefore.scode =
DISP_E_PARAMNOTFOUND;
if(FAILED(colors->Add(&sVarArray, &sVarColorBefore)))
;
As result I have yellow color because the blue value
of the RGB is always zero!!!