Hi guys,
I am working on a project in C# to create a forms application. I would like to use IFileDialog and other functionality that is part of the native Windows API (or however ti should be called).
Starting out I knew absolutely nothing about interop or the Windows API. I am starting to learn but at times it can be hard to find very basic info on certain aspects. Therefore I have a (probably trivial/stupid) questions:
HResults are used often. As I understand, HResults are nothing more than a 32 bit entity where the different bits supply info on the result of certain operations. In some code I found online I often see things like int hres = -2147467259;
. Being a total noob I went to check what this means. -2147467259
is 0xFFFFFFFF80004005
and in the online documentation at MSDN I can see that 0x80004005
signifies E_FAIL
aka unspecified error. My question is, what is up with the FFFFFFFF
part? Couldn't they just have used int hres = 0x80004005
? Maybe this is very obvious and I'm a total noob, but still :)