A call to an OS function failed

Recently encountered a problem in the project development, draw a Scrollbox with BCB6, and then use the program to build 10 scrollBox as the parent class panel, Panel in the child thread access. But whenever you access panel-> When the handle parameter is handled, the thread either gets stuck or reports an error “A call to an OS function failed”. I searched for a long time, but I couldn’t find the reason. Because the project code is relatively complex, then I want to build an empty project directly, click to add components, access can be normal. The appearance of the problem is vague. Later in the process of debugging found that when the panel was created, the first call panel-> Handle, then the subsequent access in the child thread will not make an error. Although the problem seems to be solved, we still don’t know why it happened. I will take this as a note for future reference.
PS: In access parameter panel-> In debugging Handle, an error will sometimes occur: “Class already exists. Code: 1410.”

Reproduced in: https://www.cnblogs.com/kamiya/p/11162723.html

Read More: