04-21-2017 11:27 AM
Run into this weird problem. The inherited code has ~ 10 thousand lines.
InsertTreeItem(panel, TREE, .............., NULL);
causes crash ONLY in debug version ! not in release version.
The Tree is defined as an "int", the last parameter (NULL) is invalid, so crash make sense. But ONLY in debug version ?! How could this happen ?
From customer point of view, don't fix it if not broken (and I am not paid to fix bugs. It's a hardware upgrade project.);
from developer point of view, I can't debug this file if not fixed.
04-22-2017 05:24 PM
Not sure why it does not crash in the executable, but that line appears a bit strange: supposing TREE is the name of the tree control, the correct way of addressing it shuld be
InsertTreeItem(panel, PANEL_TREE, .............., NULL);
04-24-2017 10:07 AM
Thanks for reply.
There are several panels in that .uir file. So it's not just PANEL_TREE.
To simplify the I change it to TREE when post. The problem is the last parameter: NULL.
04-24-2017 10:53 AM
Typecast to int will stop the crash, but fix all instances ?
04-25-2017 03:31 AM
NULL is not necessarily an error: like any other control that accepts tag/value elements, it can have several value types; NULL can be a valid item value for a tree which accepts strings or pointers.
You could fix your problem simpy changing tree settings instead of several lines of code, if it matches how the value elements is expected to be used.
Nevertheless, if this is exactly the code the executable is build upon and the UIR it is using, it should crash as well: could you be using a different code/UIR?