<?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 Activating Data Frame in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/activating-data-frame/m-p/602393#M16153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wrote two codes for activating the second data frame in arcmap,the first one works on but the second doesn't and I get the error "object doesn't support this action" Iwant to understand why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1st code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMaps As IMaps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMaps = pMxDoc.Maps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pMaps.Item(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc.Activeview=pMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; 2nd Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMaps As IMaps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMaps = pMxDoc.Maps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pMaps.Item(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pMap&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveview.FocusMap=pMap&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 Dec 2011 10:10:40 GMT</pubDate>
    <dc:creator>nassar1nassar2</dc:creator>
    <dc:date>2011-12-11T10:10:40Z</dc:date>
    <item>
      <title>Activating Data Frame</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/activating-data-frame/m-p/602393#M16153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I wrote two codes for activating the second data frame in arcmap,the first one works on but the second doesn't and I get the error "object doesn't support this action" Iwant to understand why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1st code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMaps As IMaps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMaps = pMxDoc.Maps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pMaps.Item(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc.Activeview=pMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; 2nd Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMxDoc As IMxDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMxDoc = ThisDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMaps As IMaps&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMaps = pMxDoc.Maps&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pMap As IMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pMap = pMaps.Item(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Dim pActiveView As IActiveView&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveView = pMap&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; Set pActiveview.FocusMap=pMap&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Dec 2011 10:10:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/activating-data-frame/m-p/602393#M16153</guid>
      <dc:creator>nassar1nassar2</dc:creator>
      <dc:date>2011-12-11T10:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Activating Data Frame</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/activating-data-frame/m-p/602394#M16154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the first example, you're setting the document's active view to the map you got from the document's maps collection.&amp;nbsp; In other words, you're changing the map referenced by the document from one map (or page layout) to another.&amp;nbsp; The second example doesn't work because it doesn't make any logical sense.&amp;nbsp; You're getting the map in the same way but instead of using it to set the document's active view you're QI'ing from IMap to IActiveView and changing the focus map reference.&amp;nbsp; The IActiveView reference you're working with is the map you got from the maps collection.&amp;nbsp; Changing any of its properties is not going to affect the document because there is no relationship between the document and that map.&amp;nbsp; You get the error because the action you're taking isn't implemented.&amp;nbsp; In this scenario the IActiveView reference is a map.&amp;nbsp; Changing the focus map of a map to another map doesn't make sense.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Dec 2011 13:30:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/activating-data-frame/m-p/602394#M16154</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-12-12T13:30:52Z</dc:date>
    </item>
  </channel>
</rss>

