|
POST
|
See my code below: // fc - a feature class w/ multiple feature records ESRI.ArcGIS.Location.RouteEventSourceClass rteEventSourceClass; rteEventSourceClass = fc as ESRI.ArcGIS.Location.RouteEventSourceClass; But the value of the rteEventSourceClass is null. Did I do something wrong? I want to retrieve the rteEventSourceClass values. Thanks.
... View more
09-26-2013
08:14 AM
|
0
|
4
|
1662
|
|
POST
|
Should see the RouteEventSourceClass rather than the RouteEventSource in VS Object Browser. Thread is to be closed.
... View more
09-26-2013
07:40 AM
|
0
|
0
|
792
|
|
POST
|
Reviewed VS Object Browser again and found that I mis-understood something there. I should view the RouteEventSourceClass (the co-calss) Will close this thread.
... View more
09-26-2013
07:38 AM
|
0
|
0
|
759
|
|
POST
|
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
... View more
09-26-2013
07:36 AM
|
0
|
0
|
3080
|
|
POST
|
In stead of using IRouteEventSource, I used co-class: RouteEventSource and the compile error was gone. public string GetRouteMeasureClass(IWorkspace ws, string fName) { IFeatureWorkspace fWs = (IFeatureWorkspace)ws; IFeatureClass fClass = fWs.OpenFeatureClass(fName); ESRI.ArcGIS.Location.RouteEventSource rteEventSource; rteEventSource = (ESRI.ArcGIS.Location.RouteEventSource)fClass; ... } But another problem occurs. In VS 2010 Object Browser: RouteEventSource is shown as an interface, which contains IDataset only. Whilst in ESRI literature, it is a co-class. There is something incorrect. I have reported it another thread (http://forums.arcgis.com/threads/93431-Subclass-RouteEventSource). I will close this one.
... View more
09-26-2013
06:30 AM
|
0
|
0
|
739
|
|
POST
|
Neil: You are right - It is a co-class. But it displays as an interface in VS 2010 Object Browser (see the image in my 1st post). There is something incorrect. How do you think? Thanks for your feedback. Shaning
... View more
09-26-2013
06:10 AM
|
0
|
0
|
759
|
|
POST
|
In ESRI's Exploring ArcObjects, Vol. 1 p967, it is stated that the RouteEventSource is subclass of a Feature Class. However, in VS 2010 Object Browser, it is an interface (see the attached image). I wish ESRI Developer Team take a look on it. [ATTACH=CONFIG]27780[/ATTACH]
... View more
09-26-2013
03:32 AM
|
0
|
3
|
1035
|
|
POST
|
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
... View more
09-26-2013
03:12 AM
|
0
|
0
|
3080
|
|
POST
|
I need to make a correction here - In VS 2010 Object Browser, it shows that Both the IRouteEventSource and RouteEventSource are interfaces. However, in ESRI's Exploring ArcObjects (Vol. 1, p967), it states that RouteEventSource is s sub-class of a feature class, which means it can be used anywhere a feature class can be. I have created another thread to mention this issue (http://forums.arcgis.com/threads/93431-Subclass-RouteEventSource?p=331925#post331925). The RouteEventSource has 2 interfaces, one of which is the IRouteEventSource. The IRouteEventSource has the Property: RouteLocator. To get the RouteLocator property, I tried this piece of code below, ESRI.ArcGIS.Location.RouteEventSource rteEventSource; // RouteEventSource - an interface, contains IDataset only rteEventSource = (ESRI.ArcGIS.Location.RouteEventSource)fClass; // fClass is a FeatureClass ESRI.ArcGIS.Location.IRouteEventSource rteEventSource2 = (ESRI.ArcGIS.Location.IRouteEventSource)rteEventSource; but got error on the last line of the code with InvalidCastException: 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)).
... View more
09-25-2013
11:16 AM
|
0
|
0
|
792
|
|
POST
|
Using the approach at 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/#comment-1423, but it does not work.
... View more
09-25-2013
08:41 AM
|
0
|
0
|
3080
|
|
POST
|
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.
... View more
09-25-2013
07:48 AM
|
0
|
5
|
11401
|
|
POST
|
From this ArcObjects diagram at: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000, it can be seen that the RouteEventSource class has 2 interfaces, and one of the interfaces is the IRouteEventSource. However, in VS 2010 Object Browser, I can see that the IRouteEventSource contains dozens of methods and properties, but none of the methods and properties of the IRouteEventSource is displayed in the RouteEventSource class. Can someone explain this? Besides, I want to create a RouteEventSource object, how can it implement the IRouteEventSource? Thanks.
... View more
09-25-2013
07:11 AM
|
0
|
2
|
1069
|
|
POST
|
The IFeatureWorkspace has the methods like that: OpenFeatureClass(), OpenTable(), ... The ESRI.ArcGIS.Location.IDatabaseLocatorWorkspace does not have this kind of methods. In order to open a LocatorClass in the ESRI.ArcGIS.Location.IDatabaseLocatorWorkspace, how can it be done? I wish ESRI's Linear Reference group or some ArcObjects professionals can help me for this issue. Thanks.
... View more
09-25-2013
05:05 AM
|
0
|
1
|
853
|
|
POST
|
Revised the code as: public ESRI.ArcGIS.Location.RouteMeasureLineLocationClass GetRouteMeasureClass(ESRI.ArcGIS.Location.IDatabaseLocatorWorkspace ws, string fName) { IFeatureWorkspace fWs = (IFeatureWorkspace)ws; ESRI.ArcGIS.Location.RouteMeasureLineLocationClass fcLoc = (ESRI.ArcGIS.Location.RouteMeasureLineLocationClass)(fWs.OpenFeatureClass(fName)); return (ESRI.ArcGIS.Location.RouteMeasureLineLocationClass)(fWs.OpenFeatureClass(fName)); } Got The runtime error at the Line: Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Location.IRouteLocation'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{354B908D-3BBA-11D4-9FCC-00C04F6BDF06}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
... View more
09-25-2013
03:46 AM
|
0
|
0
|
726
|
|
POST
|
I want to open an ESRI.ArcGIS.Location.RouteMeasureLineClass from a GeoDB. From http://resources.esri.com/help/9.3/arcgisengine/arcobjects/esriLocation/Location_overview.htm I got Open LocalLocatorWorkspace. Then I used the code below: public ESRI.ArcGIS.Location.RouteMeasureLineLocationClass GetRouteMeasureClass(ESRI.ArcGIS.Location.IDatabaseLocatorWorkspace ws, string fName) { IFeatureWorkspace fWs = (IFeatureWorkspace)ws; return (ESRI.ArcGIS.Location.RouteMeasureLineLocationClass)(fWs.OpenFeatureClass(fName)); } But got error: Cannot implicitly convert type 'ESRI.ArcGIS.Geodatabase.IFeatureClass' to 'ESRI.ArcGIS.Location.RouteMeasureLineLocationClass'. An explicit conversion exists (are you missing a cast?) How can a proper casting be applied? Thanks.
... View more
09-24-2013
11:43 AM
|
0
|
2
|
979
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-18-2023 10:02 AM | |
| 3 | 07-14-2023 12:29 PM | |
| 1 | 04-02-2021 12:16 PM | |
| 1 | 07-24-2017 11:31 AM | |
| 1 | 04-04-2016 03:59 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-01-2025
11:58 AM
|