3

Ok, I can trap the COM exception and convert the ErrorCode to the proper enum, (e.g. esriGeometryError.E_GEOMETRY_WRONGTYPE). But is there a way to get the error description from the enum? For example, when I mouse over esriGeometryError.E_GEOMETRY_WRONGTYPE in Visual Studio I get a popup that says "The geometry parameter was of the wrong type for the method." It would be great to retrieve that information programatticaly once the exception is trapped. Any help greatly appreciated!

1 Answer 1

4

The Message property of the COMException will contain the string you are looking for. See this article for code examples of error handling with HRESULTS and messages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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