Closed Carterpersall closed 2 months ago
You're right. Unfortunately, there's no explanation on errors, and that's valid for all ImageList functions. I made them return E_FAIL
on error, since there's nothing useful to be reported.
Let me know if this works for you.
While troubleshooting an issue in my code, I was encountering errors from
hImageList::ReplaceIcon
. However, the error code being returned was 0 (Operation Completed Successfully). So I did some digging and found thatImageList_ReplaceIcon
does not callSetLastError()
, causing the returned error being the error code set by some previous command.I confirmed this by calling
SetLastError()
myself with some other error code before callinghImageList::ReplaceIcon
, and the error it returned was in fact the code I had set inSetLastError()
. To further confirm thatImageList_ReplaceIcon
does not callSetLastError()
, I debugged my code in Visual Studio and viewed the disassembly ofImageList_ReplaceIcon
, and confirmed that there are no code paths that lead toSetLastError()
.See the problematic call to
GetLastError()
here