laptop and a wrench

Bug

Calling IStyleGallery::LoadStyle fails with an unspecified error for a ServerStyleGallery

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM001002
SubmittedFebruary 7, 2006
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.1
Version FixedN/A
StatusFixed

Workaround

The server style gallery doesn’t have an initialized “targetfile” so you need to set it before doing anything. You don’t see this issue with the regular stylegallery because the application sets up the “targetfile” at startup.You need to do it like this:Public Sub Test()Dim pSG As IStyleGallerySet pSG = New ServerStyleGalleryDim pSGS As IStyleGalleryStorageSet pSGS = pSG'TODO - CHANGE THIS TO POINT TO A PATH YOU CAN WRITE TOpSGS.TargetFile = "C:\temp\test.ServerStyle"' TODO - CHANGE THIS TO POINT TO YOUR OWN SERVER STYLE FILE.Dim strStyleFile As StringstrStyleFile = "C:\ArcGIS\Styles\ESRI_Optimized.ServerStyle"pSG.LoadStyle strStyleFile, "Text Symbols"MsgBox pSG.ClassCountEnd Sub

Steps to Reproduce

Bug ID: NIM001002

Software:

  • No Product Found

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