Select to view content in your preferred language

Arcobject Ienvelope implementation.

2778
4
Jump to solution
04-22-2015 10:26 AM
Jose_LuisGarcinuno-Oporto
Occasional Contributor

if (pEnvelopeFeedback != null)

                        {                          

                           //   EnvelopeClass();

                            IEnvelope pEnvelope = new EnvelopeClass();

                            ISpatialFilter pSpatialFilter = new SpatialFilterClass();

                            pEnvelope = pEnvelopeFeedback.Stop();

                            pSpatialFilter.Geometry = pEnvelope;

                            pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelContains;

                            pSpatialFilter.GeometryField = GeometryColumn;

                            ISelectionSet2 pselset;

                            IFeatureCursor pFeaturecursor;

                            pFeaturecursor = pFeatureClass.Search(pSpatialFilter, false);

                            int FeatureCount;

                            FeatureCount = pFeatureClass.FeatureCount(pSpatialFilter);

                            //MessageBox.Show(FeatureCount.ToString());

                            IFeature pFeature;

                            pFeature = pFeaturecursor.NextFeature();

I have a message about these implementations Ienvelope and ISpatialFilter for both the message said : interop type .....can not be embedded. Use the applicable interface instead??

I checked other implementation and this is the correct way to do it.

0 Kudos
1 Solution

Accepted Solutions
WayneGuidry
Occasional Contributor

Open the Properties window of the Assembly and make sure to set Embed Interop Type to false on each of the ESRI references of your project.

View solution in original post

0 Kudos
4 Replies
WayneGuidry
Occasional Contributor

Open the Properties window of the Assembly and make sure to set Embed Interop Type to false on each of the ESRI references of your project.

0 Kudos
Jose_LuisGarcinuno-Oporto
Occasional Contributor

It did works, but why?

0 Kudos
WayneGuidry
Occasional Contributor

It has to do with a new change at .NET 4/4.5 that ESRI dll's do not need.

You can read more about it at the bottom of the following link (section called Using Embed Interop Types property on referenced assemblies):

http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000nzv000000

Jose_LuisGarcinuno-Oporto
Occasional Contributor

Thanks a lot Wayne.

0 Kudos