laptop and a wrench

Bug

The error, "Error HRESULT E_FAIL has been returned from a call to a COM component" displays with IEnumStyleGalleryItem.Next method.

Last Published: August 25, 2014 ArcGIS Engine
Bug ID Number NIM060178
SubmittedAugust 18, 2010
Last ModifiedJune 5, 2024
Applies toArcGIS Engine
Version found10.0 Beta
Program languageAll
Operating SystemWindows OS
Operating System Version7 64 Bit
Version Fixed10.1
StatusFixed

Workaround

The sample executes successfully after adding the statement 'gallery.Clear();' is added. IStyleGallery gallery = new ServerStyleGalleryClass(); gallery.Clear(); IStyleGalleryStorage galleryStorage = (IStyleGalleryStorage)gallery; galleryStorage.AddFile("ESRI.ServerStyle"); IEnumStyleGalleryItem styleGalleryItems = gallery.get_Items("Color Ramps", "", "Default Ramps"); styleGalleryItems.Reset(); IStyleGalleryItem galleryItem = styleGalleryItems.Next(); while (galleryItem != null) { if (galleryItem.Category == "Default Ramps") { } galleryItem = styleGalleryItems.Next(); }or another workaround option:Replace: IStyleGallery gallery = new ServerStyleGalleryClass();With IStyleGallery gallery = new ESRI.ArcGIS.Framework.StyleGalleryClass();

Steps to Reproduce

Bug ID: NIM060178

Software:

  • ArcGIS Engine

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options