IApplicationWindows DataWindows never returns results

689
2
04-17-2012 01:12 PM
RobinCarnow
New Contributor
I have implemented a context menu option which, when clicked, tries to find the current ITableWindow which is being shown to the user.

An accepted way of doing this in an addin is to call:
   //to get a reference to the application
   IApplicationWindows pApplicationWindows= (IApplicationWindows)ArcMap.Application;

   //to get the set of data windows
   ISet pDataWindows = pApplicationWindows.DataWindows;

and then you can iterate over the set to check each IDataWindow to see if it has what you want.

Below is a link which takes the same approach of iterating over the data windows, checking each one for a particular characteristic (see method FindGraphWindow):
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000081w000000

The problem I'm having is that since I have started using ArcMap 10, the call to pApplicationWindows.DataWindows always returns an empty set. 
I have tested my ArcMap extension which was migrated to ArcMap 10 and the same issue (via IHookHelper) exists for it.  This is working in ArcMap 9.x.

Does anyone know why this might be causing this issue in ArcMap 10 and not in ArcMap 9?

Any help would be much appreciated.
0 Kudos
2 Replies
RobinCarnow
New Contributor
Bump

I don't know what could be causing ArcMap not to have the current DataWindows and I can't seem to find any way to get them besides the above described method.

Any help would be valuable.
0 Kudos
AlexanderGray
Occasional Contributor III
Correcting an ArcMap framework level change that occurred between ArcGIS 9.3 and 10. The attribute table window is no longer a data window but rather a  dockable window. As a result, a different set of ArcObjects calls to the new ArcGIS 10 interface�??ITableWindow3�??using the .FindOpenTableWindows method is needed to get the ITableWindow object.


http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000035n000000
0 Kudos