I got an issue with the parameter value's datatype returned when using composite type parameters. In my case, I create a composite of DEWorkspaceType and DEFeatureClassType:

IGPCompositeDataType gpCompositeDataType = new GPCompositeDataTypeClass();
gpCompositeDataType.AddDataType(new DEWorkspaceTypeClass());
gpCompositeDataType.AddDataType(new DEFeatureClassTypeClass());

No matter what I select in my tool, e.g .gdb, .shp etc, I get "DEWorkspaceType" in the unpacked IGPValue.DataType.

If I switch the sequence of the types, using DEFeatureClassTypeClass as the first datatype in the composite, I get DEFeatureClass as the parameter value type.. no matter what I select in the dialog.

Am I left with parsing/guessing the datatype in the string from IGPValue.GetAsText() ?

(version: 10.0 SP5)

  • Seems like a bug. You can always check what type the resulting IGPValue is by querying for implemented interfaces, such as IDEFeatureClass or IDEWorkspace3 . Will that do the trick?
    – Petr Krebs
    May 22 '13 at 15:53
  • DIM SUM as (new DEWorkspaceTypeClass());=(new DEFeatureClassTypeClass()); ??
    – lewis
    May 23 '13 at 15:11
  • @PetrKrebs, i tried both "if (val is IDEFeatureDatasetType)" and checking the name of the IGPValue.DataType.Name without any luck.
    – Oyvind
    Aug 12 '13 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.