Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone know how to use ArcObjects (specifically ArcGIS Engine for me) to import a bookmark (saved as a .dat) that was created and saved externally using ArcMap?

I have an ArcGIS Engine application that uses the ControlsMapManageBookmarksCommandClass, but this does not have Load/Save options that the ArcMap bookmark control does.

I've searched all documentation and forums with no luck.

share|improve this question
    
Right. All kinds of ways to use/update existing bookmarks within a document but no actual example on how to utilize saved bookmarks. The AOIBookmark supports the IPersisStream interface. For more info on implementing persistence go here: edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM/… – Jakub May 18 '11 at 17:58
    
You can also store the bookmarks in the *.MXD file, the bookmark commands works after you have loaded an MXD. – MathiasWestin May 20 '11 at 8:49

It appears .dat files are structured storage files. Google turns up lots on: read structured storage c#.

private void LoadBookmarks()
{
    string path = @"C:\projects\forums\bookmarks.dat";
    if (StgIsStorageFile(path) == 0)
        Debug.Print("is structured storage");
    else
        Debug.Print("not a structured storage file");
}
[DllImport("ole32.dll")]
    static extern int StgIsStorageFile(
        [MarshalAs(UnmanagedType.LPWStr)]
        string pwcsName);

Also see this question Is there any library to access OLE Structured Storage from C#? on Stack Overflow.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.