I would like to "Bullet-Proof" my apps. (and before the jokes come, Yes I do realize their is no such thing as "Bullet-PROOF" so maybe "Resistant" should be used instead.
Basically, what I would like to do is semi-easily track down bugs 5 yrs from now that I write today (either from ignorance, misunderstanding, etc) so I have set out that my next major project I try to declare correctly and add debugging to every routine (in the case I miss something, or something changed in the years to come)
In my attempt, I could use some help explaining a few things to me. As I see it when using API then you have to use documentation to determine if it returns 0 for no errors or some other value for errors, OR the other way around (so I get that part) but some things elude me at the moment.
On ERROR...(I get I can only get the correct error if I use ERR for Pb caught-able errors, and GetLastError for Windows errors, but does ON ERROR catch both, most of both, or for that matter could I use my own "ON" <enter value here> statement?)
Callbacks and WndProc...(I get these, I can declare a callback in many ways, but for readability if I use)
In some areas, it may be considered "Nit-Picking" but in this case I consider "Nit-Picking" saving myself hours if not days tracking down "bugs" that creep up lonnnng after I coded certain functions, and what was the standard when I coded it, is no longer the standard
Basically, what I would like to do is semi-easily track down bugs 5 yrs from now that I write today (either from ignorance, misunderstanding, etc) so I have set out that my next major project I try to declare correctly and add debugging to every routine (in the case I miss something, or something changed in the years to come)
In my attempt, I could use some help explaining a few things to me. As I see it when using API then you have to use documentation to determine if it returns 0 for no errors or some other value for errors, OR the other way around (so I get that part) but some things elude me at the moment.
On ERROR...(I get I can only get the correct error if I use ERR for Pb caught-able errors, and GetLastError for Windows errors, but does ON ERROR catch both, most of both, or for that matter could I use my own "ON" <enter value here> statement?)
Callbacks and WndProc...(I get these, I can declare a callback in many ways, but for readability if I use)
Code:
DECLARE FUNCTION Mdi_Dialog_Proc( _ BYVAL hWnd AS DWORD, _ ' window handle BYVAL uMsg AS DWORD, _ ' type of message BYVAL wParam AS DWORD, _ ' first message parameter BYVAL lParam AS LONG _ ' second message parameter ) AS LONG
- Is lParam supposed to be long or dword? (semantics I know), also
- The return is supposed to be dword? (who does it return to?)
- If I have handled a message and do not want to pass a message to underlying procs (like a MDI situation) do I set the return value of the api I called? or exit function in that case before passing? (I know I ran into 1 that this blocked my app from finishing but can not think of the circumstances behind it
In some areas, it may be considered "Nit-Picking" but in this case I consider "Nit-Picking" saving myself hours if not days tracking down "bugs" that creep up lonnnng after I coded certain functions, and what was the standard when I coded it, is no longer the standard
Comment