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. theCAtlFile
wrapper, which usesHRESULT_FROM_WIN32
to 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 ofGetLastError
is directly passed toFormatMessage
.