FeatureLayer.Search fails

2609
2
Jump to solution
12-02-2015 04:08 PM
BillKorbholz
New Contributor II

I'm running Windows SDK 10.3.1. I"m trying to create a FeatureCursor. The code I'm using used to work about 3 months ago, probably under 10.2.

pLayer = pMap.Layer(0)

pFeatureLayer = pLayer

pFeatureCursor = pFeatureLayer.Search(pQueryFilter, True)

The QueryFilter is valid. But that last line of code yields Error HRESULT E_FAIL has been returned from a call to a COM component.

The only thing that looks suspicious to me is that pFeatureLayer.FeatureClass is null. I don't know if that's part of the problem, or a red herring.

Thanks in advance for your help.

Bill

0 Kudos
1 Solution

Accepted Solutions
BillKorbholz
New Contributor II

This error turned out to be caused by my using a mapped drive to the data source in the map document. I'm now guessing this had something to do with upgrading to Windows 10 and the way I mapped the drive at system startup.

View solution in original post

2 Replies
BillKorbholz
New Contributor II

This error turned out to be caused by my using a mapped drive to the data source in the map document. I'm now guessing this had something to do with upgrading to Windows 10 and the way I mapped the drive at system startup.

View solution in original post

GenaroGarcia
New Contributor III

What library (dll) are you importing in your code to get the Layer and Feature Layer objects?

0 Kudos