JasmineCorp Directory   
  
Usenet News Group Archives!!!

Usenet Groups:

 

 

 

 

 

Re: Multi-thread UI program cause modal dialog showing behind main frame
--------------------------------------------------------------------------------------------
Newsgroup: microsoft.public.vc.mfc
Posted by: Sheng Jiang[MVP]
2007-10-09 05:16:44

Actually you need to set the dialog's parent to the currect window. Either
the frame window or its last active popup window.

--
Sheng Jiang
Microsoft MVP in VC++
"Carol" wrote in message
news:1191846473.548319.140320@r29g2000hsg.googlegroups.com...
> Yes. CFileDialog is. But it does not solve the problem. I have already
> set view window as thread's pMainWnd. Some modal dialogs still go
> behind main frame, like the CFileDialog and dialogs popup from
> activex( assume I put an active in the view which would popup a modal
> dialog).
>
> Joseph M. Newcomer wrote:
> > Actually CFileDIalog IS derived from CDIalog. Check the documentation!
> > joe
> >
> >
> >
> >
> >
> > On Sun, 07 Oct 2007 03:29:22 -0700, Carol wrote:
> > >Thanks. I have already did it, set the view window as thread's
> > >pMainWnd. But it does not work. And when I said 'Modal dialog' I mean
> > >all modal dialog like the File->Open dialog, it's not derived from
> > >CDialog.
> >
> > >On 10 7 , 12 49 , "Doug Harrison [MVP]" wrote:
> > >> On Sat, 06 Oct 2007 05:08:46 -0700, jeff...@hotmail.com wrote:
> > >> >Hi,
> >
> > >> >I have a MDI program which created the view in a UI thread (I know
> > >> >it's advised not to do so, we have some reason to do it). Actually
> > >> >everything goes fine except one problem, sometimes the modal diaog
> > >> >from the main thread will be put BEHIND the main frame, causing the
> > >> >whole program locked up (because we can not click to cancel the
> > >> >dialog). I heard it's somewhat related to tooltip, but I don't know
> > >> >how to avoid it.
> >
> > >> >Any advice is appreciated.
> >
> > >> No guarantees, but setting the thread's m_pMainWnd to AfxGetMainWnd()
might
> > >> work. It should allow the CDialog code to determine your main window
to be
> > >> the dialog's parent, as it does when all the UI is in a single
thread.
> > >> Alternatively, you could try passing AfxGetMainWnd() to the CDialog
> > >> constructor.
> >
> > >> --
> > >> Doug Harrison
> > >> Visual C++ MVP
> >
> > Joseph M. Newcomer [MVP]
> > email: newco...@flounder.com
> > Web:http://www.flounder.com
> > MVP Tips:http://www.flounder.com/mvp_tips.htm- -
> >
> > - -
>
>


 

 

 

More >> 

Domain Registration:
.com .org .net
.info .biz .us