I'm doing some programming in Win32 + WTL, and I'm confused with the available types of errors.
In general, I want to check for an error, and feed it to AtlGetErrorDescription (which calls FormatMessage).
My questions are:
What's the difference between:
DWORD, returned byGetLastError.HRESULT, returned by e.g. theCAtlFilewrapper, which usesHRESULT_FROM_WIN32to convert fromDWORD.LSTATUS, returned by e.g.RegCreateKeyEx.
Which types of errors can I feed to
FormatMessage? Its signature indicates it acceptsHRESULT, but there are lots of examples where the return value ofGetLastErroris directly passed toFormatMessage.