Re: OnIdle and UI thread



I should point out that by being *extremely* careful, the cross-thread messaging problem
can be dealt with by creating structures of windows for which this is not possible.
However, MFC makes a single-thread assumption about the frame/doc/view architecture and
makes no pretensions about trying to be as careful as would be needed.
joe

On Thu, 11 Aug 2005 10:41:59 -0400, Joseph M. Newcomer <newcomer@xxxxxxxxxxxx> wrote:

>And have you tried using Spy++ to see the relationship of the windows? I don't have it,
>but I'll guess that the sort of relationship of a doc/view architecture isn't there.
>Probably implements menu items by cross-thread PostMessage, for example. And besides, it
>is not document/view architecture, so anything it does is probably quite ad hoc tuned to
>this problem, and would not generalize to doc/view architectures where there is extremely
>tight coupling.
> joe
>
>On Thu, 11 Aug 2005 10:35:04 +0800, "jeff" <bloodchen@xxxxxxxxxxx> wrote:
>
>>There is an example of this kind of app. The new beta version of IE7. The
>>mainframe and webpage window are in different thread.
>>
>>"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
>>news:7gqkf1tunqdqmk47isgig5kskrhkf04njm@xxxxxxxxxx
>>> If you create any window in thread B whose parent is in thread A (such as
>>> a view), you are
>>> doomed. There is very little payback in trying to debug such a scenario,
>>> because it means
>>> you are only debugging today's bug. Tomorrow's bug will be different. And
>>> there *will* be
>>> a bug tomorrow, just a different one. You can play this game for many
>>> years.
>>>
>>> If you have an ActiveX control that is so poorly done that it does long
>>> computations in
>>> the GUI thread, you are basically hosed. There is no architecture that
>>> will solve this if
>>> the ActiveX control has any visible manifestation, which you suggest it
>>> has.
>>> joe
>>> On Wed, 10 Aug 2005 13:46:02 +0800, "jeff" <bloodchen@xxxxxxxxxxx> wrote:
>>>
>>>>Is it the same? The control's UI part covers my view window. The same
>>>>problem, mainframe's OnIdle handler is not called when mouse pointer is
>>>>insider the control's UI (if it's in another thread).
>>>>
>>>>Best
>>>>
>>>>Jeff
>>>>"Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote in message
>>>>news:1123639644.044223.132930@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>>>>> In this case, the control should decide to launch a separate thread.
>>>>> You shouldnt mess around with it.
>>>>>
>>>>> ----------
>>>>> Ajay Kalra
>>>>> ajaykalra@xxxxxxxxx
>>>>>
>>>>
>>>
>>> Joseph M. Newcomer [MVP]
>>> email: newcomer@xxxxxxxxxxxx
>>> Web: http://www.flounder.com
>>> MVP Tips: http://www.flounder.com/mvp_tips.htm
>>
>
>Joseph M. Newcomer [MVP]
>email: newcomer@xxxxxxxxxxxx
>Web: http://www.flounder.com
>MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages