multithreading - Delphi 6 : breakpoint triggered on non-VCL thread stops main thread repaints -


i have multi-threaded delphi 6 pro application working on heavily. if set breakpoint on code runs in context of main thread (vcl thread) don't have problems. however, if breakpoint triggered on code in 1 of other threads, after continue application breakpoint, repaints vcl components on main thread (including main form) don't happen anymore. application isn't dead because other background code keeps running, main thread. it's if windows message dispatcher has been corrupted or rendered dormant.

note, in application allocate own wndproc() via allocatehwnd() on main form because need catch registered messages. wndproc() dispatch custom messages handle , if current message not handled code, pass message on calling main form's inherited wndproc(). if handle current message return wndproc() msg.result set 1 tell dispatcher message handled. can't override tform wndproc() instead of allocating own wndproc() because reason delphi vcl not pass through registered messages instantiated windows api registerwindowmessage() call.

has experienced in similar context , if so, did fix it?

-- roscherl

since call allocatehwnd, means you've created another window. mustn't take messages addressed window , forward them form's window. doing that, you're bound screw things in program, although i'm not sure how. painting problems sound plausible. should make sure it's painting problems , not main thread still suspended. debugger should able tell that. (you should call defwindowproc make allocated window handle messages you're not prepared handle yourself. , returning 1 doesn't tell dispatcher anything; dispatcher doesn't care — whoever called sendmessage wants know result.)

i promise forms capable of receiving registered window messages. override wndproc or assign new value windowproc property (and remember save old value can call after handling own messages). source of problem lies elsewhere.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -