Select to view content in your preferred language

Changing IExtension.Name and still get persistant data

746
4
06-20-2013 09:13 AM
SebastienBlier
Emerging Contributor
Hi,

I would like to rename my IExtension.Name to something else. When I do that the IPersist.Load isn't called anymore so I lost my persisted data that is already saved with the document.

Is there a way to change the IExtension.Name and then have access to the old persisted data ?

Thanks
0 Kudos
4 Replies
RichardWatson
Deactivated User
I don't think so.

Map documents (mxd) are OLE structured storage.  You can open then using tools such as stg or dfview.  When you do that what you will find is the the data persisted by an IExtension is stored in a named stream.  The name of the stream is what you specified so if you change it then it won't find the information.

It is none of my business but I wonder why you want/need to rename your extension.  If that is really critical for you then you could have an extension with your old name and another extension with your new name.  In this case you would have to write code which coordinates all of this.
0 Kudos
SebastienBlier
Emerging Contributor
I know this look weird but our extension is multilanguage and when we created our extension 10 years ago we put a localized string as the IExtension.Name so when the document is persisted the data is different depending on the current language so if I change the language of the application and restart it then the persisted data isn't loaded.

Thanks for answering I will try to find a way.
0 Kudos
SebastienBlier
Emerging Contributor
Is there a method that we could call to access the persisted data at any moment instead of waiting for IPersist::Load to be called ?
0 Kudos
RichardWatson
Deactivated User
I don't think so and I'm unclear as to how that would help you.

If you really want to get deep then you might try reading the map document (mxd) file yourself.

I suspect that you could also write a utility which renames your extension in the map document.  Of course, your customers would have to run the utility before being able to use existing map documents.
0 Kudos