<?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 What's wrong in my code?&amp;nbsp; If you can help? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403328#M10772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See my code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fc - a feature class w/ multiple feature records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Location.RouteEventSourceClass rteEventSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rteEventSourceClass = fc as ESRI.ArcGIS.Location.RouteEventSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the value of the rteEventSourceClass is null.&amp;nbsp; Did I do something wrong?&amp;nbsp; I want to retrieve the rteEventSourceClass values.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Sep 2013 15:14:59 GMT</pubDate>
    <dc:creator>ShaningYu</dc:creator>
    <dc:date>2013-09-26T15:14:59Z</dc:date>
    <item>
      <title>What's wrong in my code?  If you can help?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403328#M10772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See my code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fc - a feature class w/ multiple feature records&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Location.RouteEventSourceClass rteEventSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rteEventSourceClass = fc as ESRI.ArcGIS.Location.RouteEventSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the value of the rteEventSourceClass is null.&amp;nbsp; Did I do something wrong?&amp;nbsp; I want to retrieve the rteEventSourceClass values.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 15:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403328#M10772</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-26T15:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong in my code?  If you can help?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403329#M10773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;From the ArcObjects diagram (&lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000&lt;/A&gt;&lt;SPAN&gt;), it is known that the ESRI.ArcGIS.Location.RouteEventSourceClass is a sub-class of FeatureClass.&amp;nbsp; In this piece of code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Location.RouteEventSourceClass rtEvtSourceClass = (ESRI.ArcGIS.Location.RouteEventSourceClass)fc;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // fc - a feature class&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Got InvalidCastException:&amp;nbsp; Unable to cast COM object of type 'System.__ComObject' to class type 'ESRI.ArcGIS.Location.RouteEventSourceClass'. COM components that enter the CLR and do not support IProvideClassInfo or that do not have any interop assembly registered will be wrapped in the __ComObject type. Instances of this type cannot be cast to any other class; however they can be cast to interfaces as long as the underlying COM component supports.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why can't cast here?&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 16:31:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403329#M10773</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-26T16:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong in my code?  If you can help?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403330#M10774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As the continuation of 2nd post of the thread, I followed the recommendation in the error message, used interface and then did the casting, like that:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ESRI.ArcGIS.Location.IRouteEventSource rtEvtSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtEvtSourceClass = (ESRI.ArcGIS.Location.IRouteEventSource)fc;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, got new error:&amp;nbsp; Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Location.IRouteEventSource'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{641755F0-B7DE-11D3-9F7C-00C04F6BDF06}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then, I opened the Registry Editor to search the {641755F0-B7DE-11D3-9F7C-00C04F6BDF06}.&amp;nbsp; The result shows that it is at&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\Interface\.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For the 'No such interface supported ...', I referred to &lt;/SPAN&gt;&lt;A href="http://www.huggill.com/2012/09/06/solving-an-exception-occurred-in-publishing-no-such-interface-supported-exception-from-hresult-0x80004002-e_nointerface-with-visual-studio-2012-rc/"&gt;http://www.huggill.com/2012/09/06/solving-an-exception-occurred-in-publishing-no-such-interface-supported-exception-from-hresult-0x80004002-e_nointerface-with-visual-studio-2012-rc/&lt;/A&gt;&lt;SPAN&gt; provided procedure:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Run Command Prompt as Administrator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. regsvr32 actxprxy.dll&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Restart Visual Studio&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem is still there and the error message is the same.&amp;nbsp; What I should do next?&amp;nbsp; Welcome your suggestion or hint.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 17:36:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403330#M10774</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-26T17:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong in my code?  If you can help?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403331#M10775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Make sure your reference to fc is also an interface rather than a class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While .NET technically supports 'class casting', to ease the transition from VB6, you'll run into all sorts of problems with ArcObjects and COM interop.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 18:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403331#M10775</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-09-26T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: What's wrong in my code?  If you can help?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403332#M10776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The cast posted before was not correct.&amp;nbsp; In stead of&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ESRI.ArcGIS.Location.IRouteEventSource rtEvtSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rtEvtSourceClass = (ESRI.ArcGIS.Location.IRouteEventSource)fc;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It should be&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClass fc = (IFeatureClass)rtEvtSourceClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thread is to be closed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2013 18:06:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/what-s-wrong-in-my-code-nbsp-if-you-can-help/m-p/403332#M10776</guid>
      <dc:creator>ShaningYu</dc:creator>
      <dc:date>2013-09-27T18:06:18Z</dc:date>
    </item>
  </channel>
</rss>

