Error Handling in COM/ATL
The native compiler support in VC++ 5.0 provides a helper function that allows us to propogate meaningful error information up to the client. This article explains the exception mechanism in COM/ATL.
The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: Error Handling in COM/ATL
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

J RichviewPosted Jul 22, 2011, 9:59 AM
I'm looking at some old C++ code that I didn't write. Some of the com objects' methods generate compiler warnings because apparently ATL by default assumes keyword "nothrow" on any method declared using macro STDMETHOD. So, a couple questions for you please: 1) Do you know whether these methods throwing an exception will cause problems at runtime? I'm assuming not since they only generate compiler warnings, not errors, but it's hard to find information about these details. 2) If you look at the declaration of STDMETHOD (I'm using VS2010) you find a #define that changes STDMETHOD to assume "throw" rather than "nothrow" but it's hard to find information on the consequences of using that #define. I assume this would at least make the warning go away, but it's not clear whether it's a good idea to use this. How would you approach this problem if you were me? Thanks!