troubleshooting Question

Error message strategy for a C++/ATL COM server

Avatar of hedgehope
hedgehopeFlag for United Kingdom of Great Britain and Northern Ireland asked on
C++Editors IDEs
2 Comments1 Solution249 ViewsLast Modified:
I have developed a C++/ATL COM server application that needs a better error return strategy than I'm using at the moment. Basically I have lots of possible errors that need returning as codes and optional string descriptions. I've had a look around and it looks like I need to use MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, code_200_hex_and_above) to define my codes and then join them up with the message strings in some kind of table.  Then I can use an HRESULT and Error("Message goes here") to pass the code and description over. Can someone please show me a nice way of implementing this (should I be using the resource compiler?)

Thanks
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros