I have a multi-threaded Delphi 6 Pro application that I am currently working on. If I set a breakpoint on any code that runs in the context of the main thread (VCL thread), I have no problem. However, if the breakpoint is triggered by any code in one of my other threads, after I continue the application from the breakpoint, all redraws to the VCL components in the main thread (including the main form) no longer occur. The application is not dead because another background code continues to work, only the main thread. It is as if the Windows Message Manager was damaged or turned out to be inactive.
Please note: in this application, I highlight my own WndProc () via allocateHwnd () in the main form, because I need to catch certain logged messages. From this WndProc (), I send any custom messages that I process, and if the current message is not processed by my code, I pass the message, invoking the main view inherited by WndProc (). If I process the current message, I simply return from my WndProc () with Msg.Result set to 1 to tell the dispatcher that the message has been processed. I cannot just override TForm WndProc () instead of highlighting my own WndProc (), because for some reason Delphi VCL does not go through registered messages created with the Windows API call RegisterWindowMessage ().
Has anyone experienced this in a similar context, and if so, what did you do to fix it?
- roscherl
source share