HRESULT questions

Started by
15 comments, last by Laroche 22 years, 4 months ago
You might think so, but!

WORD: 16 bit unsigned integer
DWORD: 32 bit unsigned integer

Search for DWORD in the MSDN Library and you''ll find the definition. And a bunch of others too.

-Benny-
-Benny-
Advertisement
Argh.. Am I cursed today ?

Well M$ is wrong, the definition of a word is the size of a processor register. So unless windows is still 16bit, a word should be 32 bits...

OH, that's why they're using DWORDs everywhere ...

Edited by - Fruny on November 22, 2001 6:35:10 PM
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Fruny
Argh.. Am I cursed today ?

No. The second time around you were working based on the true definitions of a word and a doubleword, but realize that those definitions are platform specific. Since the Windows API has existed since the 286, those definitions were originally 16-bit based but have had to carry over to Win32 for backwards compatibility.
so where would you use WORD and DWORD? and do they store numbers or what?
Anything you want to know about hresults are in msdn and winerror.h including the bitwise description of an hresult. basically they''re made of a facility code to tell where it came from, a severity bit to determine if its an error or not and if its an error how serious it is, and finally an error code.

If you want to make you''re own hresult use this

#define E_MYERROR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 512 or greater)

use FACILITY_ITF because thats the facility set aside for user error codes. and values less than 512 are reserved.


to simplify

Less than 0 = Error
Greater than 0 = success

Any more questions....consult WinError.h
Bobby Ward - COM Guru in training
alright i understand now, and ill change my source names thanks to everyone who answered, it cleared things up a lot!
Check out my music at: http://zed.cbc.ca/go.ZeD?user_id=41947&user=Laroche&page=content
quote:Original post by Grugnorr
Just talking from memory( and not DDR ), isn´t an HRESULT a dword? . I don´t think it is a pointer type...

.-LAROCHE: They are costants used to enumerate errors(or absent of errors)

What the hells!


Actually, you''re right, HRESULT is typedef''d to a dword.



"And that''s the bottom line cause I said so!"

Cyberdrek
Headhunter Soft
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer
[Cyberdrek | ]

This topic is closed to new replies.

Advertisement