The text of this article is not in this database — only its details are. Read it on the old site: Error Handling in COM/ATL
1 Comment
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
The text of this article is not in this database — only its details are. Read it on the old site: Error Handling in COM/ATL
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment.
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!