'If the *. serverstyle file is not set to another one after it is imported, an error occurs when you try again. The AddFile method and removefile method will fail. The test environment VB6.0 + arcengine Dev 9.1 Private sub commandementclick () Dim AAA as istylegallery Set AAA = new serverstylegallery Dim BBB as istylegallerystorage Set BBB = aaa Bbb. AddFile app. Path & "transportation. serverstyle" Bbb. removefile app. Path & "transportation. serverstyle" AAA. Clear Set AAA = nothing End sub Private sub form_load () Dim A as istylegallery Set a = new serverstylegallery Dim B as istylegallerystorage Set B = B. targetfile = app. Path & "transportation. serverstyle" Msgbox B. canupdate (App. Path & "transportation. serverstyle ") Dim symbol as imarkersymbol Set symbol = new simplemarkersymbol Dim item as istylegalleryitem Set item = new serverstylegalleryitem Item. Item = symbol Item. Category = "guide sign" Item. Name = "test" A. additem item B. removefile app. Path & "transportation. serverstyle" 'If the following sentence is not set, an error will occur. B. targetfile = "D:/DF. serversytle " . clear set a = nothing Set B = nothing 'B. targetfile = "" cannot be blank end sub |