Hi Juan, > Martin wrote: > > But we could use the expression > > "MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, > > ERROR_FILE_NOT_FOUND)" instead. > > A shorter version is > HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND).
Yes, this would also be a possible solution. But HRESULT_FROM_WIN32 contains some extra logic, which is not necessary in this case since we know already there occured an error. (Sure - this can be optimized away be the compiler.) > Question: could you not change _ILCreateFromPathA to > return an HRESULT? Sure. If you also change "your" ;-) _ILCreateFromFindDataA() to return HRESULT, we can make at least some error returns a bit more descriptive. Regards, Martin
