Issues with IVersionChangesWindow interface.

338
1
Jump to solution
12-30-2013 05:03 AM
Highlighted
Occasional Contributor II
Hi,

I am using IVersionChangesWindow to display the version changes between two specified versions. The window for VersionChange is getting displayed, however it is not showing changes in the two versions.

Below is my code to initialize and show the window.

   public void ShowVersionChangesWindow(string sourceVersionName, string targetVersionName)         {             try             {                 UtilityMethods utilMethods = new UtilityMethods();                 IVersion sourceVersion = utilMethods.GetVersionByName(sourceVersionName);                 IVersion targetVersion = utilMethods.GetVersionByName(targetVersionName);                  IMap pMap = (Common.GlobalFunction.Instance.G_PApps.Document as IMxDocument).FocusMap;                 IActiveView pActiveView = pMap as IActiveView;                  ITrackCancel trackCancel = new CancelTrackerClass();                  IVersionChangesWindow pVersionChngesWin = new VersionChangesWindow();                 pVersionChngesWin.Initialize(Common.GlobalFunction.Instance.G_PApps.hWnd,                     pMap, sourceVersion, targetVersion, pActiveView.FullExtent, trackCancel);                  pVersionChngesWin.Visible = true;             }             catch (Exception ex)             {                               }         }


AS explained above, I am passing in the two version names which definitely have changes between them. If I use the built in Version Change window in the ArcMap, I can see the changes.

So, I assume, I might have missed some thing obvious that is causing this issue. I have checked the values of all arguments to Initialize method and they all are fine.

Any help on this issue, is appreciated.

Thanks and regards.
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Occasional Contributor II
Fixed the issue.

For anyone who is interested, I am posting the solution.

The problem was the way I was retrieving the source and target versions. I needed two versions, the source and target. I was connecting to the SDE workspace twice, one for each versions and so I had reference to different workspaces.

We modified the code as below to get the version.

  public IVersion GetVersionByName(string versionName)         {             try             {                 IDocumentDatasets doc = pMxDoc as IDocumentDatasets;                 IVersionedWorkspace ver_ws = doc.Datasets.Next().Workspace as IVersionedWorkspace;                 return ver_ws.FindVersion(versionName);             }             catch (Exception ex)             {                 return null;             }         } 

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
Occasional Contributor II
Fixed the issue.

For anyone who is interested, I am posting the solution.

The problem was the way I was retrieving the source and target versions. I needed two versions, the source and target. I was connecting to the SDE workspace twice, one for each versions and so I had reference to different workspaces.

We modified the code as below to get the version.

  public IVersion GetVersionByName(string versionName)         {             try             {                 IDocumentDatasets doc = pMxDoc as IDocumentDatasets;                 IVersionedWorkspace ver_ws = doc.Datasets.Next().Workspace as IVersionedWorkspace;                 return ver_ws.FindVersion(versionName);             }             catch (Exception ex)             {                 return null;             }         } 

View solution in original post

Reply
0 Kudos