<?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 issue catching arcmap events in C++ in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/issue-catching-arcmap-events-in-c/m-p/762733#M20198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm attempting to use IActiveViewEvents to catch any table of contents changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following &lt;/SPAN&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Cpp/ArcGIS%20Development/eventhandling.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Cpp/ArcGIS%20Development/eventhandling.htm&lt;/A&gt;&lt;SPAN&gt;, I should instanciate my class extending IActiveViewEvents using new. However visual won't do that, as told in &lt;/SPAN&gt;&lt;A href="http://support.microsoft.com/kb/181265" rel="nofollow noopener noreferrer" target="_blank"&gt;http://support.microsoft.com/kb/181265&lt;/A&gt;&lt;SPAN&gt; due to the pure virtual function error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm attempting to use IDispEventImpl as in &lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/06wtz4t5%28v=VS.80%29.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/06wtz4t5%28v=VS.80%29.aspx&lt;/A&gt;&lt;SPAN&gt; . I should derive my class from IDispEventImpl. Putting &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public IDispEventImpl&amp;lt;/*nID*/ 1, CMyClass,&amp;amp;__uuidof(IActiveViewEvents)&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;seems OK, but filling SINK_MAP failed, I used&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; BEGIN_SINK_MAP(CMyClass)
&amp;nbsp; SINK_ENTRY(1,__uuidof(IActiveViewEvents), 3, OnContentsChanged)
 END_SINK_MAP()&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Here, I'm stuck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should my class implement IActiveLayerEvents too ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 08:25:15 GMT</pubDate>
    <dc:creator>iadavuth</dc:creator>
    <dc:date>2021-12-12T08:25:15Z</dc:date>
    <item>
      <title>issue catching arcmap events in C++</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/issue-catching-arcmap-events-in-c/m-p/762733#M20198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm attempting to use IActiveViewEvents to catch any table of contents changes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Following &lt;/SPAN&gt;&lt;A href="http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Cpp/ArcGIS%20Development/eventhandling.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Cpp/ArcGIS%20Development/eventhandling.htm&lt;/A&gt;&lt;SPAN&gt;, I should instanciate my class extending IActiveViewEvents using new. However visual won't do that, as told in &lt;/SPAN&gt;&lt;A href="http://support.microsoft.com/kb/181265" rel="nofollow noopener noreferrer" target="_blank"&gt;http://support.microsoft.com/kb/181265&lt;/A&gt;&lt;SPAN&gt; due to the pure virtual function error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I'm attempting to use IDispEventImpl as in &lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/06wtz4t5%28v=VS.80%29.aspx" rel="nofollow noopener noreferrer" target="_blank"&gt;http://msdn.microsoft.com/en-us/library/06wtz4t5%28v=VS.80%29.aspx&lt;/A&gt;&lt;SPAN&gt; . I should derive my class from IDispEventImpl. Putting &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public IDispEventImpl&amp;lt;/*nID*/ 1, CMyClass,&amp;amp;__uuidof(IActiveViewEvents)&amp;gt;
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;seems OK, but filling SINK_MAP failed, I used&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; BEGIN_SINK_MAP(CMyClass)
&amp;nbsp; SINK_ENTRY(1,__uuidof(IActiveViewEvents), 3, OnContentsChanged)
 END_SINK_MAP()&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Here, I'm stuck.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should my class implement IActiveLayerEvents too ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/issue-catching-arcmap-events-in-c/m-p/762733#M20198</guid>
      <dc:creator>iadavuth</dc:creator>
      <dc:date>2021-12-12T08:25:15Z</dc:date>
    </item>
  </channel>
</rss>

