<?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 Accessing COM custom extension from add-in in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/accessing-com-custom-extension-from-add-in/m-p/535807#M14486</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made an add-in (,net 3.5 , ArcMap v.10.2) that contains a button.&lt;/P&gt;&lt;P&gt;From this button I try to access to a custom COM Extension class, that implements IExtension.&lt;/P&gt;&lt;P&gt;From other COM classes I just do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14164793397184569" jivemacro_uid="_14164793397184569"&gt;
&lt;P&gt;var extUID = new UIDClass {Value = "&amp;lt;CustomExtensionName&amp;gt;"&lt;/P&gt;
&lt;P&gt;return ArcMap.Application.FindExtensionByCLSID(extUID) as &amp;lt;CustomExtension&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to use this function from add-in, I get IExtension, but when I try to cast is to my custom Extension class I just get null or InvalidCastException..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Nov 2014 10:29:23 GMT</pubDate>
    <dc:creator>RomCoh</dc:creator>
    <dc:date>2014-11-20T10:29:23Z</dc:date>
    <item>
      <title>Accessing COM custom extension from add-in</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/accessing-com-custom-extension-from-add-in/m-p/535807#M14486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I made an add-in (,net 3.5 , ArcMap v.10.2) that contains a button.&lt;/P&gt;&lt;P&gt;From this button I try to access to a custom COM Extension class, that implements IExtension.&lt;/P&gt;&lt;P&gt;From other COM classes I just do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14164793397184569" jivemacro_uid="_14164793397184569"&gt;
&lt;P&gt;var extUID = new UIDClass {Value = "&amp;lt;CustomExtensionName&amp;gt;"&lt;/P&gt;
&lt;P&gt;return ArcMap.Application.FindExtensionByCLSID(extUID) as &amp;lt;CustomExtension&amp;gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to use this function from add-in, I get IExtension, but when I try to cast is to my custom Extension class I just get null or InvalidCastException..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Nov 2014 10:29:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/accessing-com-custom-extension-from-add-in/m-p/535807#M14486</guid>
      <dc:creator>RomCoh</dc:creator>
      <dc:date>2014-11-20T10:29:23Z</dc:date>
    </item>
  </channel>
</rss>

