Click here to Skip to main content
15,912,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Time Pin
toxcct14-Nov-07 5:05
toxcct14-Nov-07 5:05 
AnswerRe: Time Pin
Maximilien14-Nov-07 5:10
Maximilien14-Nov-07 5:10 
QuestionHow to convert char* to System::String^ Pin
Boroumandan14-Nov-07 3:41
Boroumandan14-Nov-07 3:41 
AnswerRe: How to convert char* to System::String^ Pin
toxcct14-Nov-07 3:46
toxcct14-Nov-07 3:46 
GeneralRe: How to convert char* to System::String^ Pin
toxcct14-Nov-07 6:19
toxcct14-Nov-07 6:19 
AnswerRe: How to convert char* to System::String^ Pin
toxcct14-Nov-07 6:31
toxcct14-Nov-07 6:31 
QuestionRe: how to use Date Time picker control Pin
David Crow14-Nov-07 3:24
David Crow14-Nov-07 3:24 
QuestionDoModal not returning. Pin
Mr Simple14-Nov-07 2:32
Mr Simple14-Nov-07 2:32 
Hi,
I have created a 'please wait' dialog which is loaded when a user clicks on a button. A new thread is launched to load the button so the main thread can continue what it is doing.

The button code;

CPleaseWait *dlgWait = new CPleaseWait(this);<br />
AfxBeginThread(PleaseWaitThread, dlgWait);


Then in the new thread;

<br />
CPleaseWait dlg = (CPleaseWait*)lpParam;<br />
dlg.DoModal();<br />
<br />
return 0;


It is very simple code, which I have had working before.

The problem is that when called, DoModal never returns, so the dialog doesnt get displayed (it doesnt get as far as InitDialog). The main thread continues running however.

If I place a 'return;' directly after the AfxBeginThread() then the dialog DOES display. If I place 'while(1) Sleep(100);' (or any other code) after the AfxBeginThread() then it does not return.

I have narrowed the problem down to a particular line (510) within 'dlgcore.cpp'

// disable parent (before creating dialog)<br />
HWND hWndParent = PreModal();<br />
AfxUnhookWindowCreate();<br />
BOOL bEnableParent = FALSE;<br />
if (hWndParent && hWndParent != ::GetDesktopWindow() && ::IsWindowEnabled(hWndParent))<br />
{<br />
::EnableWindow(hWndParent, FALSE); /////// <--- THIS HANGS FOREVER<br />
    bEnableParent = TRUE;<br />
}



Creating a modeless dialog does not fix the problem - Create() does not reurn instead.

Does anyone have any ideas as to what the problem could be?
Please advise.
Thank you!
AnswerRe: DoModal not returning. Pin
Roger Broomfield14-Nov-07 3:01
Roger Broomfield14-Nov-07 3:01 
AnswerRe: DoModal not returning. Pin
Nelek14-Nov-07 3:03
protectorNelek14-Nov-07 3:03 
AnswerRe: DoModal not returning. Pin
KarstenK14-Nov-07 3:14
mveKarstenK14-Nov-07 3:14 
AnswerRe: DoModal not returning. Pin
David Crow14-Nov-07 3:15
David Crow14-Nov-07 3:15 
AnswerRe: DoModal not returning. Pin
Mr Simple14-Nov-07 5:37
Mr Simple14-Nov-07 5:37 
GeneralRe: DoModal not returning. Pin
Nelek14-Nov-07 20:07
protectorNelek14-Nov-07 20:07 
Questionhow to use Date Time picker control Pin
gb_my14-Nov-07 0:51
gb_my14-Nov-07 0:51 
AnswerRe: how to use Date Time picker control Pin
Roger Broomfield14-Nov-07 1:01
Roger Broomfield14-Nov-07 1:01 
QuestionNTFS junction point Pin
LiveShell14-Nov-07 0:50
LiveShell14-Nov-07 0:50 
QuestionMedia files Pin
zakkas248314-Nov-07 0:49
zakkas248314-Nov-07 0:49 
GeneralRe: Media files Pin
Matthew Faithfull14-Nov-07 3:40
Matthew Faithfull14-Nov-07 3:40 
QuestionRemove toolbar button border in release mode Pin
cagespear14-Nov-07 0:11
cagespear14-Nov-07 0:11 
Questioncan any body tell me how to fetch the text from the list control Pin
Deepu Antony13-Nov-07 23:44
Deepu Antony13-Nov-07 23:44 
AnswerRe: can any body tell me how to fetch the text from the list control Pin
chandu00413-Nov-07 23:47
chandu00413-Nov-07 23:47 
GeneralRe: can any body tell me how to fetch the text from the list control Pin
Deepu Antony13-Nov-07 23:58
Deepu Antony13-Nov-07 23:58 
GeneralRe: can any body tell me how to fetch the text from the list control Pin
ThatsAlok14-Nov-07 0:29
ThatsAlok14-Nov-07 0:29 
QuestionRe: can any body tell me how to fetch the text from the list control Pin
David Crow14-Nov-07 3:28
David Crow14-Nov-07 3:28 

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.