AnsweredAssumed Answered

Error when using ServerStyleGalleryClass ?

Question asked by taibc on Aug 22, 2013
Latest reply on Aug 22, 2013 by taibc

First, I used:

IStyleGallery styleGallery = new StyleGalleryClass();

I can run my program without error (on my computer). But this require using ESRI.ArcGIS.Framework (need install Arcgis Desktop). And, I can't use for my client computers.
So, I used ServerStyleGalleryClass, and I used "MakeServerStyleSet" utility to convert my style file into server style.

Then, I used below codes, but I got the error "Error HRESUT _EFAIL has been returned from a call to a COM component" (because after getting Items, styleItems is NULL)
           IStyleGallery styleGallery = new ServerStyleGalleryClass();              IStyleGalleryStorage styleStor = (IStyleGalleryStorage)styleGallery;                         string startupPath = Environment.CurrentDirectory;               string strFilePath = startupPath + "\\Data\\Styles\\SoDo.ServerStyle";             styleStor.AddFile(strFilePath);                          IEnumStyleGalleryItem styleItems;                                     styleItems = styleGallery.get_Items("Line Symbols", strFilePath, "Default");  // Return NULL value             styleItems.Reset();             IStyleGalleryItem styleGalleryItem = styleItems.Next();

Are there anyone know what's wrong ?

Thanks and regards,