Click here to Skip to main content
16,004,991 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: database creation Pin
Alexinuk25-Feb-03 3:43
Alexinuk25-Feb-03 3:43 
GeneralRe: database creation Pin
Anonymous25-Feb-03 5:34
Anonymous25-Feb-03 5:34 
GeneralRe: database creation Pin
Alexinuk25-Feb-03 21:26
Alexinuk25-Feb-03 21:26 
GeneralRe: database creation Pin
Anonymous25-Feb-03 21:33
Anonymous25-Feb-03 21:33 
Generalhelp! visual C++ 6.0 Pin
abritto25-Feb-03 3:17
abritto25-Feb-03 3:17 
GeneralRe: help! visual C++ 6.0 Pin
benjymous25-Feb-03 3:28
benjymous25-Feb-03 3:28 
GeneralDebug Version of MAPI Pin
Anonymous25-Feb-03 3:11
Anonymous25-Feb-03 3:11 
GeneralCan´t access close button in a modeless cdialog Pin
Stefan_L_0125-Feb-03 2:56
Stefan_L_0125-Feb-03 2:56 
Hello

I use a modeless CDialog to display some CProgessCtrl controls. It has a Close button which i want to use to abort a loop. The progress controls of the modeless dialog are updated during this loop.

The constructor of the dialog is

CDialogVorgang::CDialogVorgang(CWnd* pParent /*=NULL*/)<br />
	: CDialog()<br />
{<br />
	Create(CDialogVorgang::IDD, pParent);<br />
	<br />
//{{AFX_DATA_INIT(CDialogVorgang)<br />
	//}}AFX_DATA_INIT<br />
}<br />


and i initialize it with

<br />
		// Modeless dialog init<br />
		CDialogVorgang* pDlgVorgang = new CDialogVorgang();	<br />
		pDlgVorgang->SetWindowText("Datenbank Aktualisierung");<br />
		pDlgVorgang->m_cProgressVorgang.SetRange(0, 3);<br />
		pDlgVorgang->m_cProgressGesamt.SetRange(0, v_oaV->GetSize());<br />
		<br />
                // Show Dialog<br />
		pDlgVorgang->ShowWindow(SW_SHOW);<br />
<br />
                // is somehow necessary to display static text (??)<br />
		pDlgVorgang->UpdateWindow();	<br />
               <br />
                // loop<br />
		for (int nv = 0; nv < v_oaV->GetSize(); nv++)<br />
		{<br />
			pDlgVorgang->IncGesamt();<br />
			pDlgVorgang->ResetVorgang();<br />
			pDlgVorgang->IncVorgang();<br />
<br />
                        .....<br />
                }<br />
<br />


The dialog shows up, and the progess controls are adjusted correctly(in the functions IncGesamt, ResetVorgang etc), but i can´t press the cancel button during the loop. Only AFTER the loop has stopped i can close the dialog.
It´s also strange that i had to include the UpdateWindow function. Without it static text would not have showed up, even the cancel button was invisible.
I added for testing a windowproc message handling function to my modeless cdialog class, but during the loop it is never called.

Is it possible that the loop - and thus the adjustment of the progess controls - starts to quickly before the window is registered? Do i have to wait a bit, and if so, how?

Thank you for any help

niklas
GeneralRe: Can´t access close button in a modeless cdialog Pin
Joan M25-Feb-03 3:16
professionalJoan M25-Feb-03 3:16 
GeneralRe: Can´t access close button in a modeless cdialog Pin
Stefan_L_0126-Feb-03 1:58
Stefan_L_0126-Feb-03 1:58 
GeneralRe: Can´t access close button in a modeless cdialog Pin
Joan M26-Feb-03 7:37
professionalJoan M26-Feb-03 7:37 
GeneralRe: Can´t access close button in a modeless cdialog Pin
Joan M26-Feb-03 7:45
professionalJoan M26-Feb-03 7:45 
QuestionCopywright? Pin
Vladimir Georgiev25-Feb-03 2:27
Vladimir Georgiev25-Feb-03 2:27 
AnswerRe: Copywright? Pin
jhwurmbach25-Feb-03 2:32
jhwurmbach25-Feb-03 2:32 
AnswerRe: Copywright? Pin
Willem B25-Feb-03 2:35
Willem B25-Feb-03 2:35 
AnswerRe: Copywright? Pin
AlexO25-Feb-03 2:41
AlexO25-Feb-03 2:41 
AnswerRe: Copywright? Pin
Jon Hulatt25-Feb-03 3:00
Jon Hulatt25-Feb-03 3:00 
GeneralRe: Copywright? Pin
Willem B25-Feb-03 3:29
Willem B25-Feb-03 3:29 
GeneralRe: Copywright? Pin
Jon Hulatt25-Feb-03 3:34
Jon Hulatt25-Feb-03 3:34 
GeneralRe: Copywright? Pin
Willem B25-Feb-03 3:46
Willem B25-Feb-03 3:46 
GeneralRe: Copywright? Pin
AlexO25-Feb-03 3:37
AlexO25-Feb-03 3:37 
AnswerRe: Copywright? Pin
benjymous25-Feb-03 3:01
benjymous25-Feb-03 3:01 
GeneralRe: Copywright? Pin
jhwurmbach25-Feb-03 3:28
jhwurmbach25-Feb-03 3:28 
GeneralRe: Copywright? Pin
Jon Hulatt25-Feb-03 3:37
Jon Hulatt25-Feb-03 3:37 
GeneralRe: Copywright? Pin
jhwurmbach25-Feb-03 3:47
jhwurmbach25-Feb-03 3:47 

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.