IErrorInfo in C #

There is C ++ COM. And that sometimes challenges SomeMethod() . C ++ Com supports ISupportErrorInfo and populates IErrorInfo . How can I get IErrorInfo.Description in C #?

This code catches the error, but there is no cpp message in it.

 try { COM.SomeMethod() } catch (COMException exn) { string ACppErrorMessage = exn.message; outputError(ACppErrorMessage); } 
+4
source share
1 answer

According to the documentation, the Description IErrorInfo field displays exceptions in the Message object if HRESULT contains this information, otherwise it is simply filled with default values.

If Message empty, I can only assume that the information is not returned from HRESULT .

+3
source

Source: https://habr.com/ru/post/1486190/


All Articles