Exceptions being thrown
-
I have exceptions being thrown from two locations within my code, both of them are predefined tree view macros.
TreeView_GetItemRect() TreeView_GetItem()
If I change the first macro to it's SendMessage() equivlent, the exception is no longer thrown, but as for the second macro I just cannot get it working as it should. Has anybody come across this before? Google has been of little help to me.Waldermort
-
I have exceptions being thrown from two locations within my code, both of them are predefined tree view macros.
TreeView_GetItemRect() TreeView_GetItem()
If I change the first macro to it's SendMessage() equivlent, the exception is no longer thrown, but as for the second macro I just cannot get it working as it should. Has anybody come across this before? Google has been of little help to me.Waldermort
Go to your compiler debug setting and turn on, "break on 1st exception" for all exceptions type. Run the program again from the debugger and cause the exception to get thrown. As soon as the exception is thrown, your code will break and you will be able to tell from the call-stack who is throwing the exception! Inspect the code and figure out why this is happening... are you doing something wrong? did you fail to init something? etc, etc. You will need to do some work, hope this helps!
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
-
Go to your compiler debug setting and turn on, "break on 1st exception" for all exceptions type. Run the program again from the debugger and cause the exception to get thrown. As soon as the exception is thrown, your code will break and you will be able to tell from the call-stack who is throwing the exception! Inspect the code and figure out why this is happening... are you doing something wrong? did you fail to init something? etc, etc. You will need to do some work, hope this helps!
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug
It was a bug in my own code ( no surprises there ). I wasn't correctly checking the hWndFrom member within the WM_NOTIFY handler which ended up causing the code to do a custom draw on the incorrect window.
Waldermort
-
I have exceptions being thrown from two locations within my code, both of them are predefined tree view macros.
TreeView_GetItemRect() TreeView_GetItem()
If I change the first macro to it's SendMessage() equivlent, the exception is no longer thrown, but as for the second macro I just cannot get it working as it should. Has anybody come across this before? Google has been of little help to me.Waldermort
How are you calling them?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
How are you calling them?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
The problem was due to casting the LPNMHDR into a control specific struct without first checking which control sent the message. A novice mistake which I am highly embarassed about :sigh:
Waldermort
-
I have exceptions being thrown from two locations within my code, both of them are predefined tree view macros.
TreeView_GetItemRect() TreeView_GetItem()
If I change the first macro to it's SendMessage() equivlent, the exception is no longer thrown, but as for the second macro I just cannot get it working as it should. Has anybody come across this before? Google has been of little help to me.Waldermort
-
It was a bug in my own code ( no surprises there ). I wasn't correctly checking the hWndFrom member within the WM_NOTIFY handler which ended up causing the code to do a custom draw on the incorrect window.
Waldermort
Always feels good to find the bug :)
--- Yours Truly, The One and Only! web: devmentor.org Design, Code, Test, Debug