Select to view content in your preferred language

No such interface supported (Exception from HRESULT: 0x80004002

10367
5
Jump to solution
09-25-2013 07:48 AM
ShaningYu
Honored Contributor
When I debugged the code:
            ESRI.ArcGIS.Location.RouteEventSource rteEventSource;
            rteEventSource = (ESRI.ArcGIS.Location.RouteEventSource)fClass;  // fClass - a feature class
            ESRI.ArcGIS.Location.IRouteEventSource rteEventSource2 = (ESRI.ArcGIS.Location.IRouteEventSource)rteEventSource;
I received the run-time error:
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)).
My CPU is in 64-bit, and I am using ArcGIS 10.1.  From this message, it appears to be that the QI fails for the interface - not supported.  From the ArcObjects diagram at http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000, the RouteEventSource class contains the IRouteEventSource interface.  However, in VS 2010 Object Browser, I can't see any IRouteEventSource member in the RouteEventSource class.  Does this observing mean that 'No such interface supported'?  If yes, how can this problem be fixed?  Thanks.
0 Kudos
1 Solution

Accepted Solutions
RichardWatson
Deactivated User
From 10.2 esriLocation.olb

    [
      odl,
      uuid(641755F0-B7DE-11D3-9F7C-00C04F6BDF06),
      helpstring("Provides access to the route event source properties."),
      helpcontext(0x00003665),
      oleautomation
    ]
    interface IRouteEventSource : IUnknown {
        [propget, helpstring("The route locator."), helpcontext(0x00003f67)]
        HRESULT _stdcall RouteLocator([out, retval] IRouteLocator** aRouteLocator);
        [propget, helpstring("The table of containing route events."), helpcontext(0x00003f85)]
        HRESULT _stdcall EventTable([out, retval] ITable** aTable);
        [propget, helpstring("The route event properties."), helpcontext(0x00003f76)]
        HRESULT _stdcall EventProperties([out, retval] IRouteEventProperties** EventProperties);
        [propput, helpstring("The distance used to expand spatial searches for laterally offset events."), helpcontext(0x00003f8e)]
        HRESULT _stdcall ExpandDistance([in] double distance);
        [propget, helpstring("The distance used to expand spatial searches for laterally offset events."), helpcontext(0x00003f8e)]
        HRESULT _stdcall ExpandDistance([out, retval] double* distance);
    };


    [
      uuid(4B194341-A3E3-11D4-9FF0-00C04F6BDF06),
      helpstring("Route event source object."),
      helpcontext(0x000035e5),
      noncreatable
    ]
    coclass RouteEventSource {
        [default] interface IUnknown;
        interface IDataset;
        interface IDatasetEdit;
        interface IDatasetEditInfo;
        interface IClass;
        interface ITable;
        interface ITableCapabilities;
        interface IObjectClass;
        interface ISubtypes;
        interface IObjectClassInfo;
        interface IObjectClassInfo2;
        interface IFeatureClass;
        interface IGeoDataset;
        interface IEventSource;
        interface IRouteEventSource;
        interface IEventSourceErrors;
        interface IVirtualTable;
        [default, source] interface IObjectClassEvents;
        [source] interface IObjectClassSchemaEvents;
    };

View solution in original post

0 Kudos
5 Replies
ShaningYu
Honored Contributor
0 Kudos
RichardWatson
Deactivated User
I would open the type library which contains RouteEventSource class using Ole2View.

Once you have it open then click in the right view which shows the IDL.  Select all the text and cut and paste to notepad (or some other tool which allows you to search).  Find the above class.  You should be able to see what interfaces it implements.
0 Kudos
ShaningYu
Honored Contributor
Richard:  Thanks for your response to my thread.  I used ole2view near 10 yrs. ago.  Now, it appears to be TOO old and it is hard to find it to download.  If the interface can't be viewed in VS Object Browser, it means that this component is not supported.  I am still struggling for it.  Thanks again.  Yours,
Shaning
0 Kudos
RichardWatson
Deactivated User
From 10.2 esriLocation.olb

    [
      odl,
      uuid(641755F0-B7DE-11D3-9F7C-00C04F6BDF06),
      helpstring("Provides access to the route event source properties."),
      helpcontext(0x00003665),
      oleautomation
    ]
    interface IRouteEventSource : IUnknown {
        [propget, helpstring("The route locator."), helpcontext(0x00003f67)]
        HRESULT _stdcall RouteLocator([out, retval] IRouteLocator** aRouteLocator);
        [propget, helpstring("The table of containing route events."), helpcontext(0x00003f85)]
        HRESULT _stdcall EventTable([out, retval] ITable** aTable);
        [propget, helpstring("The route event properties."), helpcontext(0x00003f76)]
        HRESULT _stdcall EventProperties([out, retval] IRouteEventProperties** EventProperties);
        [propput, helpstring("The distance used to expand spatial searches for laterally offset events."), helpcontext(0x00003f8e)]
        HRESULT _stdcall ExpandDistance([in] double distance);
        [propget, helpstring("The distance used to expand spatial searches for laterally offset events."), helpcontext(0x00003f8e)]
        HRESULT _stdcall ExpandDistance([out, retval] double* distance);
    };


    [
      uuid(4B194341-A3E3-11D4-9FF0-00C04F6BDF06),
      helpstring("Route event source object."),
      helpcontext(0x000035e5),
      noncreatable
    ]
    coclass RouteEventSource {
        [default] interface IUnknown;
        interface IDataset;
        interface IDatasetEdit;
        interface IDatasetEditInfo;
        interface IClass;
        interface ITable;
        interface ITableCapabilities;
        interface IObjectClass;
        interface ISubtypes;
        interface IObjectClassInfo;
        interface IObjectClassInfo2;
        interface IFeatureClass;
        interface IGeoDataset;
        interface IEventSource;
        interface IRouteEventSource;
        interface IEventSourceErrors;
        interface IVirtualTable;
        [default, source] interface IObjectClassEvents;
        [source] interface IObjectClassSchemaEvents;
    };
0 Kudos
ShaningYu
Honored Contributor
Richard:  Thanks for your response.  I reviewed VS 2010 Object Browser again and found that I mis-understood some concepts there.  I will close this thread and add the credit to your response.  Thanks again.   - Shaning
0 Kudos