# Zooming to first queried feature using ArcObjects?

I'm attempting to query a feature class for all features that meet a certain criterion (in this case, theStatusfield isNULL). However, I'm not getting very far into the attempted method before ArcMap crashes completely. I have no reasonable idea on how to trace errors that cause a program crash, for starters, so I'm more confused than necessary, I expect. I'm building this in VS 2008 Express, for what it's worth.

public void PerformAttributeQuery(ESRI.ArcGIS.Geodatabase.IFeatureClass fc) { ESRI.ArcGIS.Geodatabase.IQueryFilter queryFilter = new ESRI.ArcGIS.Geodatabase.QueryFilterClass(); queryFilter.WhereClause = "[Status] IS NULL"; // create the where clause statement

Everything is fine for that first couple of statements, but this query causes a crash:

// query the table passed into the function and use a cursor to hold the results ESRI.ArcGIS.Geodatabase.IFeatureCursor featurecursor = fc.Search(queryFilter, false);

It crashes before reaching the next line (I put in debug message boxes for testing), but I'll put it here for propriety:

ESRI.ArcGIS.Geodatabase.IFeature feature = (ESRI.ArcGIS.Geodatabase.IFeature)featurecursor.NextFeature(); ESRI.ArcGIS.ArcMapUI.IContentsView currentContentsView = ArcMap.Document.CurrentContentsView as IContentsView; ESRI.ArcGIS.Carto.IFeatureLayer featureLayer = (ESRI.ArcGIS.Carto.IFeatureLayer)currentContentsView.SelectedItem; ESRI.ArcGIS.Carto.IFeatureSelection fSelection = featureLayer as ESRI.ArcGIS.Carto.IFeatureSelection; fSelection.Add(feature); FindCommandAndExecute(ArcMap.Application as ESRI.ArcGIS.Framework.IApplication, "{AB073B49-DE5E-11D1-AA80-00C04FA37860}"); }

I cannibalized thePerformAttributeQuerysnippet to work with FeatureClasses instead of Tables (or so I had hoped), if you'd like a proper reference. My questions are:

1. How can I get better reporting of crash errors?
2. Where did I go wrong? Answer: I must shamefacedly admit that I used the wrong characters to denote the location of the feature table I was querying. Changing the[Status]in myqueryFilter.WhereClauseto"Status"quite literally solved all obvious problems.

see code below

Note that sometimes useful exception messages can be embedded inside of a fairly cryptic general message, so it is important to examine InnerExceptions.

protected override void OnClick() { string path = @"C:projectsNetToolsInfrastructureEditingTemplateMapsandGeodatabaseLocalGovernment.gdb"; try { var ws = Open(path); var fc = ((IFeatureWorkspace)ws).OpenFeatureClass("wMain"); IFeature feat = QueryFirstFeature(fc); if (feat != null) { //todo: project if necessary ((IActiveView)ArcMap.Document.FocusMap).Extent = feat.Shape.Envelope; ((IActiveView)ArcMap.Document.FocusMap).Refresh(); } } catch (Exception ex) { while (ex != null) { Debug.Print("{0}
{1}", ex.Message, ex.StackTrace); ex = ex.InnerException; } } } private IFeature QueryFirstFeature(IFeatureClass fc) { IFeature outFeat = null; IQueryFilter qf = new QueryFilterClass(); qf.WhereClause = "LASTEDITOR = 'ESRI'"; IFeatureCursor fCur = null; try { fCur = fc.Search(qf, false); outFeat = fCur.NextFeature(); } catch (Exception ex) { var ex2 = new Exception("Exception when querying with " + qf.WhereClause, ex); throw ex2; } finally { if(fCur != null) Marshal.FinalReleaseComObject(fCur); } return outFeat; }

## Zooming to first queried feature using ArcObjects? - Geographic Information Systems

title-attribute and see the main ticket https://core.trac.wordpress.org/ticket/24766 Title attributes are really something that belongs to the past. They're available only to mouse users. Screen reader users may get the title attributes (depending also from the verbosity setting they set in their screen reader) and all that text adds a terrible noise, often to communicate not so relevant information. For example, I'm not sure what kind of relevant information a sentence like ""Come here for the latest scoop."" adds to the menu item ""Blog"". The general rule the accessibility team recommends is: - if the title attribute adds relevant information: consider to make it available to all users, putting in plain text somewhere in the UI - if the title attribute doesn't add any relevant information: consider to just remove it It'd be great to consider to make the menu embrace the best practices WordPress itself (the software) adopts." afercia Active Tickets 4096 Redesign /mobile/ General defect sjardo assigned 2019-01-23T20:33:06Z 2020-04-23T09:07:17Z "Have been discussing the /mobile/ pages with @elibud. They need to be more modern and much better at informing people about the capabilities of our apps. Let's get that process going by creating a new design and then putting that live. We can remove the link to WordPress.com and replace it with a QR code and link, potentially using http://onelink.to/ " joostdevalk Active Tickets 4110 Consider to audit the headings hierarchy across the .org network General defect new 2019-01-28T22:17:23Z 2020-04-15T05:26:19Z "Headings are important not only for semantics and SEO: they are actually used by screen reader users as the [https://webaim.org/projects/screenreadersurvey7/#finding predominant mechanism to find information on a page]. For better accessibility, SEO, and semantics there are some best known practices, also recommended by the core accessibility team: - a main h1 heading should be used to communicate the main page topic - there should be only one h1 in a page - the main topic of a page is rarely the site title, this is maybe true only on the home page (and it's still matter of debate) - in all the other pages, the main h1 is meant to be used for that specific page topic - headings needs to have a correct hierarchy: no levels should be skipped There are different tools to check the headings structure of a page. For the purpose of this ticket, I've used the HeadingsMap Chrome extension. I've also collected a series of screenshots to illustrate the headings hierarchy in the main pages of the .org network as of today, January 28, 2018: https://cloudup.com/cCODexEIFbq To recap: - Home: two h1 and incorrect hierarchy - Showcase: incorrect hierarchy - Themes: two h1 and incorrect hierarchy - Plugins: two h1 - Mobile: hierarchy OK but the main page topic is not a h1 - Support: two h1 and incorrect hierarchy - Get involved (Make): two h1 and incorrect hierarchy - About: two h1 - Blog: hierarchy OK but the main page topic is not a h1 - Hosting: hierarchy OK but the main page topic is not a h1 I realize the .org network is made of different templates coming from different sources and I guess it's a complicated setup. However, it would be great to make sure the headings hierarchy is correct on all the network pages." afercia Active Tickets 4111 Consider to audit the focus style across the .org network General defect new 2019-01-28T22:37:36Z 2019-01-28T22:37:36Z "Keyboard users, or users who make a mixed use of a pointing device and keyboard, need to actually ''see'' where focus is to be able to navigate a web page using their keyboard. The focus style is a necessary indication for these users. Great care has been taken in WordPress core and the bundled themes to make the focus style as good as possible, and there's still work to do to improve it. It would be great to see also the .org network sites taking care of the focus style. For reference, this is also part of the WCAG recommendation: Success Criterion 2.4.7 Focus Visible https://www.w3.org/TR/WCAG21/#focus-visible While a complete analysis of all the links and controls across all the .org network would be impossible for me, I've taken the time to volunteer and analyze the focus style only on the main navigation menu in the main .org sections. To recap: - Home: has focus style (browser native style) - Showcase: no focus style outline: none - Themes: has focus style outline: thin dotted - Plugins: has focus style outline: thin dotted - Mobile: has focus style (browser native style) - Support: has focus style outline: thin dotted - Get involved (Make): has focus style (browser native style) - About: has focus style outline: thin dotted - Blog: has focus style (browser native style) - Hosting: has focus style (browser native style) Suggested: - never reset the native outline style, unless that's meant to provide a better, improved focus style - use a consistent style across all the pages: worth reminding the browsers native focus style greatly varies across operating systems and browsers - buttons, form elements, and custom interactive elements need a focus style as well - use a style that is compatible with Windows High Contrast mode, or provide one specifically for Windows High Contrast mode Note: in Windows High Contrast mode, basically only outline and border work. In core, https://core.trac.wordpress.org/ticket/41286 introduced a specific style that uses a transparent outline, as already done for the new block editor Gutenberg." afercia Active Tickets 4112 Proposal to change the headings hierarchy in the Home page General defect new 2019-01-29T11:01:54Z 2020-05-27T02:01:07Z "Splitting this out from #4110. The headings hierarchy in the home page has room for improvements for better SEO and accessibility: [[Image(http://cldup.com/3VdWJjlE_Q.jpeg)]] Currently, there are two h1 and one level is skipped, thus producing an incorrect hierarchy. Whether the logo should be or not be the main h1 heading can be matter of debate. However, in this case I'd say the logo should not be the main heading across the whole .org network. In this page, the main topic is clearly ""Meet WordPress"", which should be the only h1 in the page, followed by the other headings in a correct hierarchy: all the headings after ""Get started with WordPress"" should be bumped up by one level." afercia Active Tickets 4117 Proposal to change the headings hierarchy in the Support section Support Forums defect new 2019-01-29T14:19:17Z 2019-01-30T00:32:35Z "Splitting this out from #4110. The headings hierarchy in the Support section has room for improvements for better SEO and accessibility: [[Image(http://cldup.com/52hVQINjaS.jpeg)]] As mentioned in #4112 the logo shouldn't be a h1. The main topic in this page is ""WordPress Support"" and that should be the only h1 in the page. The headings hierarchy is incorrect: all the other heading should be bumped up from h3 to h2. **Categories main pages:** they look OK with the exception the logo shouldn't be a h1 see for example https://wordpress.org/support/category/basic-administration/ **Article pages:** In the article pages, for example https://wordpress.org/support/article/plugins/ [[Image(http://cldup.com/JifGmi0rEQ.png)]] - the logo shouldn't be a h1 - in the left sidebar, the ""Categories"" h2 comes before the main topic h1, which is unexpected - the hierarchy of the headings in the content is correct but there's a problem: the ""hash link"" to get the in-page link repeats the visible text. This way, all the headings have duplicated content. In the example page, any software including search engines crawlers and assistive technologies perceive the following headings content: - Introduction Introduction - Plugin Repositories Plugin Repositories - Default Plugins Default Plugins - Plugin Development Plugin Development Suggested: - the headings shouldn't contain extraneous content: the ""hash link"" should be moved out from the headings - ideally, it should have a meaningful link text, e.g.: ""link to the section Introduction"", ""link to the section Plugin Repositories"", etc. Please consider the Support section has a huge amount of sub-section, pages, and content. Going through all of them is out of the scope of this ticket. However, these are general guidelines that should be applied everywhere. " afercia Active Tickets 4119 Proposal to change the headings hierarchy in the Getting Involved (Make) section Make (Get Involved) / P2 defect new 2019-01-29T15:13:53Z 2020-04-16T05:42:58Z "Splitting this out from #4110. The headings hierarchy in the Getting Involved (Make) section has room for improvements for better SEO and accessibility: [[Image(http://cldup.com/LZpVRsMYSJ.jpeg)]] - as mentioned in #4112 the logo shouldn't be a h1 - the main topic in this page is ""Make WordPress"" and that should be the only h1 in the page **The ""teaser"" or ""kicker"" text:** it's made of two headings: h1 + h5: looks like these headings are used for visual purposes but their semantic is inappropriate and the hierarchy is incorrect. These are not headings, they're not ""titles that identify a section"". Instead, they're introductory text and they should be two styled paragraphs under the main h1 heading ""Make WordPress"" **The ""There are many different ways for you to get involved with WordPress"" h2:** Either it shouldn't be a heading at all and should be changed to a styled paragraph or if it's important to keep it as a h2, then all the headings under it should be h2. For the sake of simplicity I'd suggest the first option. **Meetings sub-section:** ""Upcoming WordPress Meetings"" should be the only heading in the page and should be a h1 **Team Updates section (similar to all the Make blogs):** [[Image(http://cldup.com/N0EP37tHOq.jpg)]] This one is a bit complicated: - there should be just one h1 in the page (""Team Updates"") - each post title shouldn't be a h1: for example, the bundled themes take care of this and in the archive pages they render the post titles as h2 - if the post titles get changed to h2, then the headings in their content would have an incorrect hierarchy: this is even more complicated by the fact some posts use h2 in their content and some posts use h3 (see the screenshot above) - in the single post page, the post title need to stay as h1 and the headings in the content need to have a correct hierarchy - worth nothing this is a problem with all the bundled themes too: an option could be displaying only the post excerpts and not the entire posts - some teams need to be informed they have to use h2 headings in their content anyways (I seem to recall with the old design h3 headings were recommended: this is no longer the case with the new design) Additionally, at the bottom of the page: - ""Post navigation"", which is visually hidden with screen-reader-text shouldn't be a h1, it needs to be changed to h2 - the three headings in the sidebar: ""About This Blog"", ""Email Updates"", ""Recent Activity"", need to be changed from h3 to h2. The current hierarchy is clearly incorrect: <<< 1 Post navigation 3 About This Blog 3 Email Updates 3 Recent Activity >>> These recommendation apply to all the Make blogs, with a few additional ones. For example, in [https://make.wordpress.org/core/ the Make/Core blog]: [[Image(http://cldup.com/MENZMYoQ3S.jpg)]] ""Welcome"" and ""Communication"" need to be changed from h3 to h2. If I'm not wrong, each team can edit this part of the page so all the teams should be informed and invited to review and edit their pages to improve the headings hierarchy. Please consider going through all the pages in the Make section is out of the scope of this ticket. However, these are general guidelines that should be applied everywhere." afercia Active Tickets 4121 Proposal to change the headings hierarchy in the Blog section WordPress.org Site defect new 2019-01-29T16:16:28Z 2021-06-02T21:28:03Z "Splitting this out from #4110. The headings hierarchy in the Blog section has room for improvements for better SEO and accessibility: [[Image(http://cldup.com/FQdgefzO-Z.jpeg)]] As mentioned in #4112 the logo shouldn't be a h1. This page should have a main h1 that identifies the main topic of the page. Suggested: ""Blog archive"". More importantly, as for the case of the Make blogs, this page suffers from a problem which is present also in the bundled themes. In the archive pages, the post titles should be h2, while in the single post page, the post title should be h1. See also #4119. Basically: - each post title shouldn't be a h2: given the current headings structure (see screenshot above), it's impossible to understand which h2 are post titles and which ones come from the post content - search engines crawlers and screen reader users can't understand which headings represent the post titles - it's impossible to change the headings from the posts content ""on the fly"" and bump them up one level automatically only in the archive page - in the single post page, the post title needs to stay as h1 and the headings in the content need to have a correct hierarchy starting from h2 - in the archive page, one option could be making the post titles h2 and displaying only the post excerpts and not the entire posts **Social sharing and sidebar headings:** At the end of the headings list the headings used for the social sharing and the ones used in the sidebar have an incorrect hierarchy, currently: <<< 2 Further Reading: 3 Share this: 3 Like this: 4 See Also: 4 Categories 4 Subscribe to WordPress News >>> Where ""Further Reading:"" is the last heading in the last post in the current archive. This hierarchy is clearly incorrect because neither the social headings or the sidebar ones are logically sub-headings of ""Further Reading:"". Suggested change (not perfect, but better): <<< 2 Social sharing 3 Share this: (output by sharedaddy so I guess it can't be changed) 3 Like this: (output by sharedaddy so I guess it can't be changed) 2 See Also: 2 Categories 2 Subscribe to WordPress News >>> **Single post page:** For example: https://wordpress.org/news/2019/01/wordpress-5-1-beta-2/ - the logo shouldn't be a h1 - the post title should be the only h1 in the page - post authors should use a correct headings hierarchy in their content starting with h1 headings, which is made easier with Gutenberg - the social sharing headings, the ""Post navigation"" heading (visually hidden with screen-reader-text), and the sidebar headings have an incorrect hierarchy, much like in the archive page. Currently: <<< 2 How to Help 3 Share this: (output by sharedaddy so I guess it can't be changed) 3 Like this: (output by sharedaddy so I guess it can't be changed) 2 Post navigation 4 See Also: 4 Categories 4 Subscribe to WordPress News >>> Where ""How to Help"" is the last heading in the example post content. Suggested change: <<< 2 Social sharing 3 Share this: 3 Like this: 2 Post navigation 2 See Also: 2 Categories 2 Subscribe to WordPress News >>> Please consider there are other pages in the Blog section (the categories ones for example). A complete analysis is out of the scope of this ticket. However, these are general guidelines that should be applied everywhere." afercia Active Tickets 4123 Proposal to improve the main navigation menu accessibility General defect Otto42 accepted 2019-01-29T18:14:14Z 2019-01-31T17:14:41Z "Several [https://www.w3.org/TR/wai-aria-practices-1.1/#html5-sectioning-elements HTML5 sectioning elements] automatically create [https://www.w3.org/TR/wai-aria-1.1/#landmark_roles ARIA landmark regions]. Landmark regions are exposed to assistive technologies and allow users to quickly find information in a page. Ideally, all content in a web page should be wrapped within landmark regions. For now, I'd like to propose to focus on the navigation menu. In this specific case it's important to know that   elements are mapped to an ARIA role=navigation. Therefore,   elements are perceived by screen readers and users can jump to them using dedicated keyboard shortcuts. In the wp.org network, some sections don't use   elements at all. For example, the home page (screenshot from Safari and VoiceOver): [[Image(http://cldup.com/t4blUGv__m.jpg)]] Other sections do use navigation landmarks but not for the main menu. For example, the Themes section has two of them: [[Image(http://cldup.com/IVXr0-FKBL.jpg)]] Same in the Plugin section sub-pages: [[Image(http://cldup.com/h7w1Zs2jNd.jpg)]] For clarity, these are respectively: - a   element with a role=""navigation"": it was common practice to repeat the role even if redundant, to support old browsers assistive technologies - a `

30 days, move to read-only in all scenarios, and update the notice to state that the forum is closed (and direct people to the new one) - After another