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
Solved! Go to Solution.
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.
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.
What library (dll) are you importing in your code to get the Layer and Feature Layer objects?