The Key Role of Emotions in Trading
16 hours ago
Got more of Google bloopers? Post 'em here!
BOOL GetMessage(PS: Just so the joke is not lost to the multitude of non-programmers (or even our lucky non-Win32 programmer comrades) I'll try to explain. The 'BOOL' on the left of GetMessage() says that the function (GetMessage) has a boolean return type. Which, for what it is worth, means that the function can either return the value 'true' or the value 'false' after executing. The boolean data-type was never a part of good-ol' C, neither C++ and hence all sorts of folks have had their own interpretation of how these two values ought to be represented. Historically, people have used integers to pose as booleans and treated the value '0' as 'false' and all others (positive or negative) as 'true'. A sin we mortal programmers are committed to, when using a boolean that really are integers under the hood, is to check if the value is '0' or not. And we just ignore the others -- we know they are true. Unfortunately, Microsoft, in this case, couldn't help but further the cause of the already abused boolean to the next step. It suggested that, we'll give you true and false all right, but you know, you'd be better keeping an eye out if you're getting a '-1' as your function's return value. Now that's a royal screw-up. Booleans are booleans. There ain't no way no self-respecting programmer will check for a petty '-1'! Never.
LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax
);
wuthering thoughts Powered By Mushblue Blogger Template Originaly by Mukka-mu | Jack Book