[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Problem with threads

Posted on 1998-04-23
4
Medium Priority
?
182 Views
Last Modified: 2010-04-10
I have created a ui thread class in an application and would like it to do
some work while returning control back to the main application.

problem is, when the thread starts running, (it starts a modeless dialog) it
effectively becomes modal, stop any user interaction with the main
application (please see the result.zip file for example).

I am sure I am not doing this properly!  How should it be done??

Also, I notice that when downloading has finished, if the dialog is not
destroyed, it sits in front of the main application window; can the dialog
be made to go behind, even if the main application window is the parent???

All answers to this perplexing problem would be very gratefully received.


Oscar


Check example url:

http://homepages.enterprise.net/impala/doc/Result.zip







0
Comment
Question by:ossentoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
faster earned 200 total points
ID: 1163480
You need modaless dialog.  I mean the UI thread shall first create the dialog, then go to the message loop.  Another thread do the background processing, such as download file, when it completes, send message to the dialog to kill it.  If the user select cancel in the UI thread, then it can terminate the working thread.
0
 

Author Comment

by:ossentoo
ID: 1163481
I'm sure it is a modeless dialog.  See code below:

      m_pDlg=new CDownDlg;
      //pDlg=(CDownDlg*)m_pDlgArr.ElementAt(m_pDlgArr.GetSize());
      BOOL bReturn=m_pDlg->Create(IDD_DOWNLOAD);
      m_pDlg->ShowWindow(SW_SHOWNORMAL);

      ASSERT(m_pDlg);


This code should create a modeless dialog.  I have used the create() method, not DoModal(), unless I am doing something else wrong!!
0
 
LVL 7

Expert Comment

by:faster
ID: 1163482
can you show me the other part of your code?
0
 

Author Comment

by:ossentoo
ID: 1163483
send me an e-mail to impala@enterprise.net  I will then send you the code.

Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question