[Dev-C++] GetLastError, or the winapi's fraud.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ce...@te...> - 2003-12-18 23:10:20
|
One more time, I find the absurd error of invalid window handle when it has no sense, when using a function that works for determine the file name for the file which will be used and adding a MessageBox in some points with hwnd or NULL as HWND. And once more it makes me mad the GetLastError() or how you win the Heaven or know what the hell shall be. So it makes me so bad mood I will reflect it in the message, with your permission, just as a vengeance for it against the keyboard. In fact, this criminal function deserves a very harder treatment, only that function makes programming very frustrating when it comes to need its output. GetLastError is supposed to catch the error code as it is generated when certain functions work. So, eg, GetDIBits finds that the pointer is not big enough. So you getlasterror and it says, "hey, you had no space there!". But since I started programming I've found invariably this: when some function generates an error and doesn't work, windows closes it before GetLastError has a chance to do something and pass the result to a message box. So, if when something fails, it lets no chance to GetLastError, what in the hell is it intended for???? How shall it be used? Shall I build a time machine, so it travels backwards in time, to came back and say "Heeeeeeyyyyy diuúd, Ai travleed through space and time, bate I got so sead that to hour that I must go to sleep the female monkey"?????. It has only worked twice, once saying that there was no memory to SetDIBits, but the bitmap was there as it should be in case it worked, and another time it said the file couldn't be created, but the file was created and written. So I alone it's male pear, these uncles make something packasgo works. Mauricio Krisna (Merry Christmas) P.S.- The ununderstandeable things are, as you can see, not needed for the message. Those are witticisms (I think my dictionary is not right in this translation) in letting the steam off. Witticisms for spanish speakers. |