HRESULT is defined as 'long', an int, so not that much can go wrong.
It's also intended to hold a result, which can be 'bool'.
But it's also misnamed as it is not a handle, which generally are
pointers; those can't be mixed up with bools.
That helps explain why Pascal could be such a pain to write. When you
have a million little integer types, all different, and that must match
exactly as well being able to interact, then life is necessarily more
difficult.
It's never that bad in real life: we don't use a different kind of
number to index floors in a building, compared with pages in a book for
example, but how many times does that cause a problem? In code, we can
write:
int page_number, floor_number
to help out.