Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am making an addin to create subsets and export them to a new workspace. I have stepped through my program and getting error at this particular line while running the addin:

pExportOp.ExportFeatureClass((IDatasetName)pFeatureClassName, 
        pQueryFilter, pSelSet, pGeometryDef, (IFeatureClassName)pOutDatasetName, 0);

Can someone help that what the error could be.

share|improve this question
    
Can you be sure to remember to tag your questions with the arcobjects tag when you are using that API? –  blah238 Jan 19 '13 at 8:57
    
can you post your exact error message here? –  vinayan Jan 20 '13 at 5:46
    
@ vinayan :: Actually, I am not getting any error in visual studio IDE I can successfully deploy my addin but when I run it, it gives error as "ArcGIS desktop has encountered a serious application error and is unable to continue.", I debugged my code step by step and found that the error is due to the following line:: pExportOp.ExportFeatureClass((IDatasetName)pFeatureClassName, pQueryFilter, pSelSet, pGeometryDef, (IFeatureClassName)pOutDatasetName, 0); Please Help...!!! –  Avinash Nirankari Jan 21 '13 at 6:28
    
are you trying to export from one geodatabase to other? or gdb to shapefile? did you try to put a try-catch block and see what the exception message gives when you debug? –  vinayan Jan 21 '13 at 7:47
add comment

1 Answer 1

[It is a comment basically. Because of the code line is not supported in comment, I posted it as an answer.]

Please be sure about following lines:

pFeatureClassName as IDatasetName != null 
pOutDatasetName as IFeatureClassName != null
share|improve this answer
    
@ emi :: I added following 'if' condition and it checked that these two are not null and I am still getting error... if ( (IDatasetName)pFeatureClassName != null && (IFeatureClassName)pOutDatasetName != null) {pExportOp.ExportFeatureClass((IDatasetName)pFeatureClassName, pQueryFilter, pSelSet, pGeometryDef, (IFeatureClassName)pOutDatasetName, 0);} –  Avinash Nirankari Jan 21 '13 at 6:24
    
please be sure any data is not null. This ArcGIS crash problem occurs when you try to do any invalid thing with arcObject API. –  Emi Jan 21 '13 at 7:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.