<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GraphicTracker fails with AccessViolationException in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355225#M9353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are reading the documentation perfectly, that is exactly how I understand it as well.&amp;nbsp; I first tried that without success in terms of performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are talking about bulk updates which are different than my continuous stream of data coming in to the application.&amp;nbsp; For my application, I will constantly receive one GPS coordinate at a time (very fast though)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a sense I am doing what you suggest: for 2 seconds my application is suspending the updates to the screen.&amp;nbsp; During that time I could have received 10 (as a guess) GPS coordinates which are processed by the GraphicTracker with the display still suspended.&amp;nbsp; Now the timer kicks off and I set the property to FALSE allowing the GraphicTracker to update the screen with my 10 updates.&amp;nbsp; After that and a 300 ms sleep, I set the property to TRUE to stop updating the screen for another 2 seconds.&amp;nbsp; This repeats giving me the performance I need in terms of CPU usage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I was receiving 10 or so transactions (all at once) every few seconds then I think the method you describe would work great for me.&amp;nbsp; But I am getting these transactions fast but one at a time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more thing, I originally tried saving up the GPS coordinates I was receiving into a queue and then doing exactly as you suggest to process them in a bulk manner.&amp;nbsp; However, depending on my circumstances I may not always have a continuous stream of data coming in.&amp;nbsp; So then I would be waiting for a queue to fill up when it may take 10 minutes.&amp;nbsp; I suppose I could try to make a hybrid with a queue while also checking elapsed time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to repeat that this code works for 15 seconds or 10 minutes before failing; I use the same data every time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 18:29:27 GMT</pubDate>
    <dc:creator>DavidClarke1</dc:creator>
    <dc:date>2013-02-28T18:29:27Z</dc:date>
    <item>
      <title>GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355217#M9345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am developing an application using the GraphicTracker to display moving icons.&amp;nbsp; I am using the Windows.Forms.Timer event to suspend the display updates for two seconds.&amp;nbsp; I have another couple subroutines that creates and removes GraphicTrackerSymbols to the tracker.&amp;nbsp; All this happens on the same thread as the Windows.Forms.Timer does excute on the main gui thread.&amp;nbsp; I have also verified this in debug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every so often the program will crash with an AccessViolationException while trying to set the GraphicTracker.SuspendUpdate property to FALSE; it ALWAYS fails on trying to set that property to "FALSE".&amp;nbsp; What I noticed was that if I do not remove any items from the GraphicTracker it does not fail.&amp;nbsp; When I am removing items here and there as needed at some point it will fail.&amp;nbsp; It may be 30 seconds or 2 minutes.&amp;nbsp; I use the exact same test data (geometry/symbols/coordinates) but it still fails at some "random" time.&amp;nbsp; The map no longer updates on the screen and the whole map is unusable.&amp;nbsp; I cannot seem to recover or continue on.&amp;nbsp; Catching the exception makes no difference as the map just will not work anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the timer code.&amp;nbsp; The timer itself is set to run every 2 seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;_gt.SuspendUpdate = False System.Threading.Thread.Sleep(300) _gt.SuspendUpdate = True&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My thoughts are that there is some timing issue while using the "Remove" method on the GraphicTracker object that conflicts with the "SuspendUpdate" property.&amp;nbsp; I have tried setting the timer to be a longer or shorter interval and also changing the "Sleep" interval but nothing seems to help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2013 12:52:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355217#M9345</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-27T12:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355218#M9346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;When I read the Java docs on GraphicTracker, it says the suspendupdate property is false by default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;public boolean &lt;STRONG&gt;isSuspendUpdate&lt;/STRONG&gt;()&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throws &lt;A href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html?is-external=true"&gt;IOException&lt;/A&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://forums.arcgis.../../../com/esri/arcgis/interop/AutomationException.html"&gt;AutomationException&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Disables automatic refreshing of the display until unsuspended or until the&amp;nbsp; display is explicitly refreshed. Suspending automatic refresh is ideal before&amp;nbsp; bulk updates.&lt;BR /&gt;&lt;BR /&gt;Description&lt;BR /&gt;Suspends update (i.e refresh) of the&amp;nbsp; display. This property is false by default. This means the GraphicTracker will&amp;nbsp; automatically refresh the display after each graphic is changed.&lt;BR /&gt; &lt;SPAN style="color:#0000cd;"&gt;&lt;STRONG&gt;Setting this property to true, moving the&amp;nbsp; graphics and then setting this property to false will result in one refresh call&amp;nbsp; and will draw all graphics at once&lt;/STRONG&gt;&lt;/SPAN&gt;. In an dynamic map, this property is not&amp;nbsp; relevant.&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 00:22:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355218#M9346</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-02-28T00:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355219#M9347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are correct. It is FALSE by default.&amp;nbsp; However, the toggling of that property is on a Windows.Forms.Timer so that it executes every 2 seconds.&amp;nbsp; That way the screen is not updating for every item I move on the screen.&amp;nbsp; In production I will be receiving a continuous stream of GPS data; at this point I am simulating that.&amp;nbsp; Because I am receiving a continuous stream of GPS data, I do not want the screen (via GraphicTracker) to update for every item; the CPU usage would be too high.&amp;nbsp; If I delay by 2 seconds and only allow the screen to update every 2 seconds (via timer) then the CPU is manageable and everything is great, until the error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keep in mind this code executes a hundred or even a few thousand times before it fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is an option to run this in Dynamic Display mode which would not require the timer and the CPU would be just a few percent but it is totally useless; there are several bugs and "limitations" when using Dynamic Display which do not allow me to do the things I need to do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 11:44:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355219#M9347</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-28T11:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355220#M9348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am developing an application using the GraphicTracker to display moving icons.&amp;nbsp; I am using the Windows.Forms.Timer event to suspend the display updates for two seconds.&amp;nbsp; I have another couple subroutines that creates and removes GraphicTrackerSymbols to the tracker.&amp;nbsp; All this happens on the same thread as the Windows.Forms.Timer does excute on the main gui thread.&amp;nbsp; I have also verified this in debug.&lt;BR /&gt;&lt;BR /&gt;Every so often the program will crash with an AccessViolationException while trying to set the GraphicTracker.SuspendUpdate property to FALSE; it ALWAYS fails on trying to set that property to "FALSE".&amp;nbsp; What I noticed was that if I do not remove any items from the GraphicTracker it does not fail.&amp;nbsp; When I am removing items here and there as needed at some point it will fail.&amp;nbsp; It may be 30 seconds or 2 minutes.&amp;nbsp; I use the exact same test data (geometry/symbols/coordinates) but it still fails at some "random" time.&amp;nbsp; The map no longer updates on the screen and the whole map is unusable.&amp;nbsp; I cannot seem to recover or continue on.&amp;nbsp; Catching the exception makes no difference as the map just will not work anymore.&lt;BR /&gt;&lt;BR /&gt;Here is the timer code.&amp;nbsp; The timer itself is set to run every 2 seconds.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_gt.SuspendUpdate = False
System.Threading.Thread.Sleep(300)
_gt.SuspendUpdate = True&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;My thoughts are that there is some timing issue while using the "Remove" method on the GraphicTracker object that conflicts with the "SuspendUpdate" property.&amp;nbsp; I have tried setting the timer to be a longer or shorter interval and also changing the "Sleep" interval but nothing seems to help.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are definitely some problems with the GraphicTracker. I would look at this thread:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/72516-Memory-Leak-with-Graphic-Tracker" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/72516-Memory-Leak-with-Graphic-Tracker&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, if you want to find out where the access violation is occurring (to provide ESRI with more information if you file a case) you can use WinDbg and/or Application Verifier:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object?p=266132#post266132" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/75186-Memory-leak-with-FeatureClass-object?p=266132#post266132&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:38:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355220#M9348</guid>
      <dc:creator>JasonPike</dc:creator>
      <dc:date>2021-12-11T16:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355221#M9349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I actually saw that thread when I did my initial scan of the ESRI forums looking for answers.&amp;nbsp; For a long while I couldn't reproduce it very well until I figured out removing items from the GraphicTracker triggers it (more often than not).&amp;nbsp; It is still variable the number of deletes before it fails.&amp;nbsp; I will take a look at WinDbg.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Most likely I will report this to ESRI since I am unable to fix this.&amp;nbsp; Unless someone has an idea for me to try (I'm out of ideas).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 15:51:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355221#M9349</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-28T15:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355222#M9350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you doing it backwards?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Java docs I posted said start with true, do stuff, then set it to false.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your code is the opposite.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
_gt.SuspendUpdate = False 
System.Threading.Thread.Sleep(300) 
_gt.SuspendUpdate = True
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:38:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355222#M9350</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2021-12-11T16:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355223#M9351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What I am doing causes the screen to only update every 2 seconds which gives me good performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What you are suggesting will cause the screen to update FOR 2 seconds then briefly pause.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this makes sense.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 17:35:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355223#M9351</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-28T17:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355224#M9352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for the confusion David, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I'm not getting it either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I read the docs, suspend update by default is false, which means as graphics are added or moved or removed, the automatic refresh will occur.&amp;nbsp; I'm stating that from the docs.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suspending the automatic update, by setting it to TRUE, is what you want for bulk updates.&amp;nbsp; Right?&amp;nbsp; Am I misreading that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You want to suspend the automatic refresh, add some Graphic Tracker geometry, symbols, etc, then unsuspend the automatic refresh of GraphicTracker, which will refresh your display.&amp;nbsp; Then you want to suspend it again while there are more things to add, then unsuspend, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you doing a partial refresh of IActiveView?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 18:00:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355224#M9352</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-02-28T18:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355225#M9353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are reading the documentation perfectly, that is exactly how I understand it as well.&amp;nbsp; I first tried that without success in terms of performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You are talking about bulk updates which are different than my continuous stream of data coming in to the application.&amp;nbsp; For my application, I will constantly receive one GPS coordinate at a time (very fast though)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In a sense I am doing what you suggest: for 2 seconds my application is suspending the updates to the screen.&amp;nbsp; During that time I could have received 10 (as a guess) GPS coordinates which are processed by the GraphicTracker with the display still suspended.&amp;nbsp; Now the timer kicks off and I set the property to FALSE allowing the GraphicTracker to update the screen with my 10 updates.&amp;nbsp; After that and a 300 ms sleep, I set the property to TRUE to stop updating the screen for another 2 seconds.&amp;nbsp; This repeats giving me the performance I need in terms of CPU usage.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I was receiving 10 or so transactions (all at once) every few seconds then I think the method you describe would work great for me.&amp;nbsp; But I am getting these transactions fast but one at a time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One more thing, I originally tried saving up the GPS coordinates I was receiving into a queue and then doing exactly as you suggest to process them in a bulk manner.&amp;nbsp; However, depending on my circumstances I may not always have a continuous stream of data coming in.&amp;nbsp; So then I would be waiting for a queue to fill up when it may take 10 minutes.&amp;nbsp; I suppose I could try to make a hybrid with a queue while also checking elapsed time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to repeat that this code works for 15 seconds or 10 minutes before failing; I use the same data every time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 18:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355225#M9353</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-28T18:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355226#M9354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How often does your GPS device poll?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can't think of another way to manually test this than to create a tool add-in that lets me suspend the GraphicTracker, then click,click,click as fast as I can in the map, store those locations in a GraphicTracker then use a timer to unsuspend the GraphicTracker after 2 or 3 seconds, which should refresh my display.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, depending on my zoom scale and how many other layers I'm displaying and what kind of symbols I'm using to display the graphics, i can't help but think at some point the GraphicTracker refresh could take longer than normal.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Approximately how many graphics have you added to your GraphicTracker object before everything goes bust?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 18:53:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355226#M9354</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-02-28T18:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355227#M9355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's a thought.&amp;nbsp; Rather than use a timer, what would happen if you added code to test whether the GraphicsTracker count was divisible by 10 with a remainder of 0, then unsuspend the auto-refresh and re-suspend it?&amp;nbsp; Then your display is refreshing for every 10 graphic objects you add, or you can set it to 20 or whatever.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps the threading is causing a problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 19:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355227#M9355</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-02-28T19:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355228#M9356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The GPS data I get is sent to me.&amp;nbsp; I cannot poll it.&amp;nbsp; I have to process it as it comes in.&amp;nbsp; Depending on the customer's environment, I could have 2-5 records a second or I could have 2-5 records in 10-15 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While in debug I have seen as few as 10 items displayed on the screen when it fails.&amp;nbsp; Plus the map I am using is scaled down.&amp;nbsp; Even if I turn off every layer, it will fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been trying to build a very small application that will exhibit the same failure but it is not complete yet.&amp;nbsp; There are a few other things I am doing that may be factors (text masking for labels and using bitmaps for icons).&amp;nbsp; If I can get that going (or rather to fail), then I could post that code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Here's a thought. Rather than use a timer, what would happen if you added code to test whether the GraphicsTracker count was divisible by 10 with a remainder of 0, then unsuspend the auto-refresh and re-suspend it? Then your display is refreshing for every 10 graphic objects you add, or you can set it to 20 or whatever.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That could work if I was always adding graphics.&amp;nbsp; However, most times I have items that move on the map so I am using the "MoveTo" method of the GraphicTracker.&amp;nbsp; The graphic count property of the GraphicTracker does not represent the number of transactions I am receiving.&amp;nbsp; Although I could have a counter for how many transactions I get.&amp;nbsp; But then I will have to take into account the times I do not get data for minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Perhaps the threading is causing a problem. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The System.Windows.Forms.Timer object executes on the main GUI thread and I even verified this within debug because I thought maybe the MSDN documentation was lying.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 19:27:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355228#M9356</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-02-28T19:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355229#M9357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;David,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a working sample that is based on a Java Tool Add-in, but I believe you can tailor it to your data stream of geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I launch ArcMap 10.0 SP5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I add a layer "ESRI_StreetMap_World_2D" from the services.argisonline.com&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I click my Add-in Tool and start clicking in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Initially, for the first five seconds, nothing shows up in the map where I've clicked.&amp;nbsp; After five seconds pass, the previous click points show up and as I click, the current points are added to GraphicTracker for the next 5 seconds, then disappear for 5 seconds, and so on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I started just above the peninsula and went counter clockwise, zig zagged until I came back around.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]22281[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Granted, I did not keep this process up for very long.&amp;nbsp; I did go throuh about 5 or 6 suspend/unsuspend iterations though without any problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;

import com.esri.arcgis.addins.desktop.Tool;
import com.esri.arcgis.arcmapui.IMxDocument;
import com.esri.arcgis.carto.IActiveView;
import com.esri.arcgis.display.IDisplayTransformation;
import com.esri.arcgis.display.IScreenDisplay;
import com.esri.arcgis.display.ISymbol;
import com.esri.arcgis.display.RgbColor;
import com.esri.arcgis.display.SimpleMarkerSymbol;
import com.esri.arcgis.display.esriSimpleMarkerStyle;
import com.esri.arcgis.enginecore.GraphicTracker;
import com.esri.arcgis.enginecore.IGraphicTrackerSymbol;
import com.esri.arcgis.framework.IApplication;
import com.esri.arcgis.geometry.IGeoTransformation;
import com.esri.arcgis.geometry.IGeometry;
import com.esri.arcgis.geometry.IPoint;
import com.esri.arcgis.geometry.ISpatialReference;
import com.esri.arcgis.geometry.Point;
import com.esri.arcgis.geometry.SpatialReferenceEnvironment;
import com.esri.arcgis.interop.AutomationException;


public class GTTool extends Tool {


&amp;nbsp;&amp;nbsp;&amp;nbsp; /**
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Called when the tool is activated by clicking it.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @exception java.io.IOException if there are interop problems.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @exception com.esri.arcgis.interop.AutomationException if the component throws an ArcObjects exception.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */
&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void activate() throws IOException, AutomationException {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void init(IApplication app) throws IOException, AutomationException {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.init(app);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxDoc = (IMxDocument)app.getDocument();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void mousePressed(MouseEvent mouseEvent) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super.mousePressed(mouseEvent);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a point based on the user's mouse click.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point p1 = new Point();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; p1.putCoords((double)mouseEvent.getX(), (double)mouseEvent.getY());

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(gt == null){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Instantiate a GraphicTracker and initialize it once.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; GraphicTracker by default will refresh after each geometry add
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gt = new GraphicTracker();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gt.initialize(mxDoc.getActiveView().getFocusMap());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Tell the GraphicTracker that we want to suspend auto refresh.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gt.setSuspendUpdate(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a timer task to toggle the automatic graphic tracker refresh for the duration in milliseconds.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; intially for 5 seconds and every 5 seconds after that.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Timer timer = new Timer();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.scheduleAtFixedRate(new UnSuspendTimerTask(), 5000, 5000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a color object that is red
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RgbColor color = new RgbColor();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color.setRed(255);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a simplemarkersymbol to be used as the symbol for the graphic placed by GraphicTracker
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twoDSymbol = new SimpleMarkerSymbol();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twoDSymbol.setStyle(esriSimpleMarkerStyle.esriSMSSquare);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twoDSymbol.setSize(4);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; twoDSymbol.setColor(color);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Tell the GraphicTracker to create a symbol and assign it to the GraphicTrackerSymbol object
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gts = gt.createSymbol((ISymbol)twoDSymbol, null);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Conver the user's map click point to something useful..
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point mapPoint = (Point)getMapCoordinatesFromScreenCoordinates(p1, mxDoc.getActiveView());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Declare ESRI named constants for projecting data between WGS1984 and NAD83 HARN AZ Central
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int wgs84 = com.esri.arcgis.geometry.esriSRGeoCSType.esriSRGeoCS_WGS1984;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int geotransformId = com.esri.arcgis.geometry.esriSRGeoTransformationType.esriSRGeoTransformation_NAD1983_To_WGS1984_1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int geotransformDirection = com.esri.arcgis.geometry.esriTransformDirection.esriTransformForward;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create a SpatialReferenceEnvironment, ISpatialReference and IGeoTransformation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialReferenceEnvironment spatialRef = new SpatialReferenceEnvironment();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISpatialReference gcswgs84 = spatialRef.createGeographicCoordinateSystem(wgs84);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeoTransformation iGeoTransformation = (IGeoTransformation)spatialRef.createGeoTransformation(geotransformId);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Set the spatial reference of the point to the spatial reference of the map window (activeView)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPoint.setSpatialReferenceByRef(mxDoc.getActiveView().getScreenDisplay().getDisplayTransformation().getSpatialReference());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Project the point from whatever the activeView spatial reference is to GCS_WGS_1984 World projection - Decimal Degrees
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapPoint.projectEx(gcswgs84, geotransformDirection, iGeoTransformation, false, 0.0, 0.0);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add the geometry and symbol to the GraphicTracker
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gt.add((IGeometry) mapPoint, gts);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (AutomationException e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static IPoint getMapCoordinatesFromScreenCoordinates(IPoint screenPoint, IActiveView activeView)throws Exception{

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (screenPoint == null || screenPoint.isEmpty() || activeView == null)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return null;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IScreenDisplay screenDisplay = activeView.getScreenDisplay();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDisplayTransformation displayTransformation = screenDisplay.getDisplayTransformation();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Returns a point in whatever coordinate system the DataFrame is set to
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return displayTransformation.toMapPoint((int)screenPoint.getX(), (int)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; screenPoint.getY());
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; public static GraphicTracker gt = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private IGraphicTrackerSymbol gts;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private SimpleMarkerSymbol twoDSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static IMxDocument mxDoc;
}

class UnSuspendTimerTask extends TimerTask{

&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override
&amp;nbsp;&amp;nbsp;&amp;nbsp; public void run() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(GTTool.gt.isSuspendUpdate()){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // make it auto refresh
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GTTool.gt.setSuspendUpdate(false);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // don't make it auto refresh
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GTTool.gt.setSuspendUpdate(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (AutomationException e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:38:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355229#M9357</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2021-12-11T16:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355230#M9358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I will take a look and compare with what I am doing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The failure only seems to happen if I am deleting graphics from the GraphicsTracker.&amp;nbsp; I never have a problem just adding graphics.&amp;nbsp; Since the failure ALWAYS happens while accessing the "SuspendUpdate" property it seems odd to me that it only fails if I have deletes occurring.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 10:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355230#M9358</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-03-01T10:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355231#M9359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are deleting graphics, and you get the failure, it would explain your AccessViolationException.&amp;nbsp; Basically, you're reading from memory something that is not there anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have you revisited your logic when it comes to removing graphics by the id integer?&amp;nbsp; Perhaps the integer id you are trying to remove is not valid?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 14:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355231#M9359</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-01T14:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355232#M9360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have reviewed my logic for days and longer.&amp;nbsp; While I am willing to accept I've made mistake I cannot see it.&amp;nbsp; I am sure the ID (GLID) is valid before deleting.&amp;nbsp; I'll have to re-explain a little bit because it might not have been clear before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error only occurs while accessing the "SuspendUpdate" property not on the "Remove" method.&amp;nbsp; If you try to remove a graphic from the Tracker with an invalid ID as you suggest, it throws a different exception on the "Remove" method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While my code executes, graphics are added and sometimes removed from the map.&amp;nbsp; At some point while setting the "SuspendUpdate" property, it fails.&amp;nbsp; I cannot pinpoint if this happens directly after removing a graphic.&amp;nbsp; But the code can successfully remove many items before failure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I comment the code to remove graphics then it works fine and I haven't seen a failure.&amp;nbsp; While this must be a vital clue it doesn't tell me why the "SuspendUpdate" is blowing up in a separate part of the code.&amp;nbsp; It makes me think the "Remove" method of the GraphicTracker is bugged.&amp;nbsp; Since the error isn't consistent in when it is thrown it is hard to say for sure.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 17:36:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355232#M9360</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-03-01T17:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355233#M9361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was able to code a small project that demonstrates the problem.&amp;nbsp; Run it and open an MXD.&amp;nbsp; Eventually, it will fail.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was done with Visual Studio 2010.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2013 16:22:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355233#M9361</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-03-04T16:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355234#M9362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In MainForm.vb, Sub PrepareMap(), are you sure this is right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;_gpsThread = New System.Threading.Thread(New System.Threading.ParameterizedThreadStart(Sub() CreateGPSData(mapCenter.X, mapCenter.Y)))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I look at examples, I haven't seen an example that creates a thread like this.&amp;nbsp; The way you did it in Sub CreateGPSData looks like the examples I've seen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/system.threading.parameterizedthreadstart.aspx?cs-save-lang=1&amp;amp;cs-lang=vb#code-snippet-2"&gt;http://msdn.microsoft.com/en-us/library/system.threading.parameterizedthreadstart.aspx?cs-save-lang=1&amp;amp;cs-lang=vb#code-snippet-2&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 20:22:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355234#M9362</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-05T20:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355235#M9363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found that as an alternate way to pass parameters when creating a thread.&amp;nbsp; Someone suggested this as a superior method than passing with the "Start" method on the Thread object.&amp;nbsp; Honestly, I am not sure about that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For this code example I can pass the parameters either way and the code still fails.&amp;nbsp; I originally did pass on the "Start" method.&amp;nbsp; I have tried MANY things to attempt to resolve this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 10:45:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355235#M9363</guid>
      <dc:creator>DavidClarke1</dc:creator>
      <dc:date>2013-03-06T10:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: GraphicTracker fails with AccessViolationException</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355236#M9364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm out of suggestions except one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you output (to the console or somewhere) the values of key, coord, coord.GLID before you make the remove call in UpdateGLID?&amp;nbsp; That woud help you sort out what values are trying to be used when it crashes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 12:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/graphictracker-fails-with-accessviolationexception/m-p/355236#M9364</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-06T12:24:36Z</dc:date>
    </item>
  </channel>
</rss>

