Click here to Skip to main content
15,919,778 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File overwriting... Pin
Raphael Kindt18-Jul-02 4:13
Raphael Kindt18-Jul-02 4:13 
GeneralRe: File overwriting... Pin
Raphael Kindt18-Jul-02 4:48
Raphael Kindt18-Jul-02 4:48 
GeneralRe: File overwriting... Pin
Bill Wilson18-Jul-02 8:42
Bill Wilson18-Jul-02 8:42 
GeneralRe: File overwriting... Pin
Raphael Kindt18-Jul-02 21:05
Raphael Kindt18-Jul-02 21:05 
QuestionChange the length of bitmap image arbitrary? Pin
chen18-Jul-02 2:39
chen18-Jul-02 2:39 
AnswerRe: Change the length of bitmap image arbitrary? Pin
includeh1018-Jul-02 5:04
includeh1018-Jul-02 5:04 
GeneralRe: Change the length of bitmap image arbitrary? Pin
chen18-Jul-02 19:58
chen18-Jul-02 19:58 
GeneralCwaitcursor and onpaint messages Pin
Anonymous18-Jul-02 2:12
Anonymous18-Jul-02 2:12 
Hi,

I have a dialog based application, in which when the user clicks a particular button, a time consuming process gets executed. Till the process completes, the user should not be allowed to operate any other button on the dialog.
Step 1
So, in the handle for the button click I add code like:
OnButton()
{
CWaitCursor myCursor;
//Long processing
}
But now, if the application is minimized, it cannot be seen again, ie the dialog becomes completely unresponsive.

Step2

So I created a thread to do the long processing. But the problem is I have to wait for the thread to finish before exiting the button handle...

Step 3
Then to be able to process message, after the AfxBeginThread, I added a message loop. Now the final code looks like:
OnButton()
{
AfxBegindThread()
while( WaitForSingleObjecT(handle, 2) = timeout || getmessage())
{
dispatchmessage()
}
}

But still this does not seem to work. Can any one help me with this?

Thanks !

GeneralActiveMovie4 Pin
Anonymous18-Jul-02 2:11
Anonymous18-Jul-02 2:11 
GeneralCEdit SetSel behavior Pin
ns18-Jul-02 1:27
ns18-Jul-02 1:27 
GeneralRe: CEdit SetSel behavior Pin
Roger Allen18-Jul-02 1:45
Roger Allen18-Jul-02 1:45 
GeneralRe: CEdit SetSel behavior Pin
ns18-Jul-02 1:51
ns18-Jul-02 1:51 
GeneralRe: CEdit SetSel behavior Pin
Roger Allen18-Jul-02 2:19
Roger Allen18-Jul-02 2:19 
QuestionWhich is the CD-RW drive ??? Pin
ilgale18-Jul-02 0:05
ilgale18-Jul-02 0:05 
GeneralHELP ME TO FIND AN ERROR Pin
Alex Cramer17-Jul-02 23:51
Alex Cramer17-Jul-02 23:51 
GeneralPDF generation control! Pin
Nish Nishant17-Jul-02 22:57
sitebuilderNish Nishant17-Jul-02 22:57 
GeneralRe: PDF generation control! Pin
Jim Crafton18-Jul-02 3:39
Jim Crafton18-Jul-02 3:39 
GeneralWriting data on a CD-ROM Pin
ilgale17-Jul-02 22:56
ilgale17-Jul-02 22:56 
GeneralRe: Writing data on a CD-ROM Pin
Scott H. Settlemier18-Jul-02 7:13
Scott H. Settlemier18-Jul-02 7:13 
GeneralRe: Writing data on a CD-ROM Pin
Anonymous18-Jul-02 20:52
Anonymous18-Jul-02 20:52 
QuestionHow to draw a rectangle around the mainframe? Pin
Dave Matrix17-Jul-02 22:47
Dave Matrix17-Jul-02 22:47 
AnswerRe: How to draw a rectangle around the mainframe? Pin
Dave Matrix18-Jul-02 1:47
Dave Matrix18-Jul-02 1:47 
GeneralRe: How to draw a rectangle around the mainframe? Pin
RChin18-Jul-02 1:54
RChin18-Jul-02 1:54 
GeneralThe Application Just Quits ! .. Very Strange. Please Help. Pin
a3gupta17-Jul-02 22:16
a3gupta17-Jul-02 22:16 
GeneralRe: The Application Just Quits ! .. Very Strange. Please Help. Pin
Fredrik Skog17-Jul-02 22:25
Fredrik Skog17-Jul-02 22:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.