GPValueTable - validation issue

Discussion created by alexeyanisimov on Oct 12, 2011
Latest reply on Oct 17, 2011 by alexeyanisimov
Hi, All!

I'm implementing a GPTool with two parameters: the first is GPGroupLayer and the second is GPValueTable. The tool must fill GPValueTable with layers from the group layer, selected in GPGroupLayer control.
Data type of the table is GPFeatureLayerType. No domains are applied to the table.
In the Validate procedure I fill the table and then validate all parameters with IGPUtilities::InternalValidate. See below the procedure of filling the table:
            long nBarrCnt = -1;
            if(FAILED(hRes = ipArrBarrs->get_Count(&nBarrCnt)))
                return hRes;

            IArrayPtr ipArrRowValues;
            if(FAILED(hRes = ipArrRowValues.CreateInstance(CLSID_Array)))
                return hRes;

            for(long nBarrIdx = 0; nBarrIdx < nBarrCnt; nBarrIdx++)
            { // For each barriers layer
                // Make GP Layer from bariers layer
                IUnknownPtr ipUnkBarr;
                if(FAILED(hRes = ipArrBarrs->get_Element(nBarrIdx, &ipUnkBarr)))
                    return hRes;

                ILayerPtr ipLayerBarr;
                if(FAILED(hRes = ipUnkBarr->QueryInterface(&ipLayerBarr)))
                    return hRes;

                IGPLayerPtr ipGPLayerBarr;
                if(FAILED(hRes = ipGPUtils->MakeGPLayerFromLayer(ipLayerBarr, &ipGPLayerBarr)))
                    return hRes;

                // Add GP Layer to the table
                if(FAILED(hRes = ipArrRowValues->Add(IUnknownPtr(ipGPLayerBarr))))
                    return hRes;
                if(FAILED(hRes = ipValueBarrTable->AddRecord(ipArrRowValues)))
                    return hRes;

                if(FAILED(hRes = ipArrRowValues->RemoveAll()))
                    return hRes;

As a result I have a list of layers, but they're not valid:

What am I doing wrong? Why the layers in the table marked with yellow diamond?

P.S. Geoprocessing utility object and the map view has no internal layers.

Thank you in advance.