<?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 SetBuddyControl error : specified cast is not valid in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/setbuddycontrol-error-specified-cast-is-not-valid/m-p/527137#M14203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm a bit new to the ArcEngine programming (but not AO) and I've just ported a poorly organized .sln into a new one, reorganizing namespaces and such but not really changing any code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I get "Specified cast is not valid" when trying to set a TOC's buddy control to an subclass of AxMapControl.&amp;nbsp; I'm able to successfully cast the custom control to AxMapControl so I feel like the underlying issue is not there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, after looking at the exception that it's throwing I notice that the actual error is coming from &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marshal.GetIDispatchForObject(_mapControl);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2011 13:55:01 GMT</pubDate>
    <dc:creator>kyleknoche</dc:creator>
    <dc:date>2011-05-12T13:55:01Z</dc:date>
    <item>
      <title>SetBuddyControl error : specified cast is not valid</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/setbuddycontrol-error-specified-cast-is-not-valid/m-p/527137#M14203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm a bit new to the ArcEngine programming (but not AO) and I've just ported a poorly organized .sln into a new one, reorganizing namespaces and such but not really changing any code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now, I get "Specified cast is not valid" when trying to set a TOC's buddy control to an subclass of AxMapControl.&amp;nbsp; I'm able to successfully cast the custom control to AxMapControl so I feel like the underlying issue is not there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, after looking at the exception that it's throwing I notice that the actual error is coming from &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marshal.GetIDispatchForObject(_mapControl);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2011 13:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/setbuddycontrol-error-specified-cast-is-not-valid/m-p/527137#M14203</guid>
      <dc:creator>kyleknoche</dc:creator>
      <dc:date>2011-05-12T13:55:01Z</dc:date>
    </item>
  </channel>
</rss>

