Select to view content in your preferred language

How to cast?

882
1
Jump to solution
09-24-2013 10:09 AM
ShaningYu
Honored Contributor
Referrring to the code at
http://edndoc.esri.com/arcobjects/9.0/Samples/Linear_Referencing/Arcmap/FindPointRouteLocation.htm
  Dim pRtLocName As IRouteLocatorName
  Set pRtLocName = New RouteMeasureLocatorName
I tried to do like that
  ESRI.ArcGIS.Geodatabase.IRouteLocatorName pRtLocatorName = new ESRI.ArcGIS.Location.RouteMeasureLocatorName();
but got the compile error:
Cannot implicitly convert type 'ESRI.ArcGIS.Location.RouteMeasureLocatorName' to 'ESRI.ArcGIS.Geodatabase.IRouteLocatorName'. An explicit conversion exists (are you missing a cast?)
I tried to cast but not successful.  How to cast the variable here?  Thanks for your hint.
0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Honored Contributor
Referring to http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000,
IRouteLocatorName pRtLocatorName = new RouteMeasureLocatorNameClass();
Solved.

View solution in original post

0 Kudos
1 Reply
ShaningYu
Honored Contributor
Referring to http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//003100000138000000,
IRouteLocatorName pRtLocatorName = new RouteMeasureLocatorNameClass();
Solved.
0 Kudos