Re: Thread Deadlock

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Scott McPhillips [MVP] (org-dot-mvps-at-scottmcp)
Date: 09/14/04


Date: Tue, 14 Sep 2004 08:38:35 -0500

rob wrote:
> Heinz & all,
>
> Thanks for your input. I have a question, though. How can an app update
> itself when an event handler of this app creates a modal dialog? The app
> does not get out of the event handler until the dialog is closed. So how
> does the message loop in the modal dialog help the app to be updated? In my
> thread I can't directly call a function in the main app (I am not sending
> messages but do a direct call). So how can a function in the main app be
> executed when the app is stuck in the event handler that popped up the modal
> dialog?
>
> Regards,
> Robert

The modal dialog

The modal dialog does not interfere with custom message processing by
the application's other windows. Direct calls that update windows
created in the main thread are not supported by MFC and can lead to
several problems. Your thread should PostMessage to request the main
thread to update things, and PostMessage to signal when it has finished.
  See http://www.mvps.org/vcfaq/mfc/index.htm

-- 
Scott McPhillips [VC++ MVP]


Relevant Pages

  • Re: postmessage to button w shift
    ... >I'm trying to postmessage to a button control in one app from another ... >running app. ... >the shift parameter in the button event handler. ... Public Const MK_LBUTTON = &H1 ...
    (microsoft.public.vb.winapi)
  • default exception handler for a class with visibility to its metho
    ... I am looking for a way that I can create a default event handler to do this. ... form for the DefaultExceptionHandler to be visible. ... it is my understanding that the ThreadEventExceptionHandler will ... For this app, ...
    (microsoft.public.dotnet.languages.csharp)
  • Can I mimic a btn_Click()?
    ... This app runs on a Windows CE .NET environment on an LCD screen but I don't ... I must be missing something from the form that the event handler has but I ... OK as long as the display is not affected. ... "Autos" window in both cases. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: can I change the event handler for an element
    ... the person who wrote the app I am working on did not. ... > I want to have the row not have any event handler on it. ... > function enableRowClick() ... If I examine this in the debugger ...
    (microsoft.public.scripting.jscript)
  • Re: Which do I use for web design?
    ... your own "framework" may simply be a re-useable controller ... servlet, an event handler base class, some of the core event handlers, and ... Views, that other bit is replacing your Controller, and that other stuff is ... in an hour or so you can have a working app that set up entity classes ...
    (comp.lang.java.programmer)