Calling IStyleGallery::LoadStyle fails with an unspecified error for a ServerStyleGallery
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM001002
已提交
February 7, 2006
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.1
修正版本
N/A
状态
Fixed
此漏洞已得到修复。 有关详细信息,请参阅“版本修复”和“其他信息”(如果适用)。
解决办法
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