how to fix TTreeView bug when using TreeNode.MoveTo?

后端 未结 2 701
攒了一身酷
攒了一身酷 2021-01-06 03:55

Using TreeNode.MoveTo(...) method sometimes does not work properly and raises an \"Access Violation\" exception.

mosttimes works and some time not.

Mosttime

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-06 04:26

    This is a first chance exception thrown by the common controls library that you do not need to act upon. It can be a bug or a deliberate exception, in either case there's nothing to pursue, the exception is handled fine by the library itself.

    The Delphi debugger may have a problem with handling the exception though. With my XE2 test, when I choose "continue" in the "debugger exception notification", I'd expect the program to continue running as normal. However, an exception dialog interrupts program execution. There's no problem running outside the debugger though, you will not see any kind of dialog that interrupts the move operation.

    Note that this is only relevant with one of the duplication steps you present (the last one). With others, there's a 'list out of bounds" exception thrown by the RTL which is caused by your code, which you need to correct.

提交回复
热议问题