Click here to Skip to main content
15,905,914 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRegistry Pin
Bram van Kampen29-Feb-08 12:14
Bram van Kampen29-Feb-08 12:14 
GeneralRe: Registry Pin
Gary R. Wheeler1-Mar-08 1:54
Gary R. Wheeler1-Mar-08 1:54 
GeneralRe: Registry Pin
Bram van Kampen6-Mar-08 13:44
Bram van Kampen6-Mar-08 13:44 
GeneralRe: Registry Pin
Gary R. Wheeler7-Mar-08 7:35
Gary R. Wheeler7-Mar-08 7:35 
GeneralRe: Registry Pin
Bram van Kampen7-Mar-08 15:10
Bram van Kampen7-Mar-08 15:10 
GeneralRe: Registry Pin
Gary R. Wheeler8-Mar-08 0:14
Gary R. Wheeler8-Mar-08 0:14 
GeneralRe: Registry Pin
Bram van Kampen8-Mar-08 10:14
Bram van Kampen8-Mar-08 10:14 
Generalneed a good method for popping between dialogs [modified] Pin
littleGreenDude29-Feb-08 9:47
littleGreenDude29-Feb-08 9:47 
I need a good method to use for popping between 3 modal dialogs. (and I guess if the answer is the dialogs shouldn't be modal, I'll accept it, but not necessarily like it).

The dialogs each display a spreadsheet which may contain a significant amount of data, so load time is a factor.

The idea is to have the user wait only during the initial load of each dialog. If the user switches to one of the other 3 dialogs, hide the current one and show the new one(already loaded with data from its previous view).

The user should be able to cycle seemlessly between the 3 dialogs.

I have a method that works well in the development environment, but fails in the release/executable.

My method was to treat one of the dialogs as the master and have the other 2 send messages back to it to open the other dialogs. The code to pop to dialog2 from dialog3 looks something like the following:

// look for parent dialog<br />
if (pWndPrev = CWnd::FindWindow(NULL, csDialogName1))<br />
{<br />
    pWndPrev->SendMessage(WM_DIALOG2CLICKFROMCHILD); // send request<br />


And, in the parent dialog, the code to call the child...

<br />
if( dlg2Exists() )<br />
{<br />
   m_dlg2->ShowWindow(SW_SHOW);<br />
   m_dlg2->SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);<br />
}<br />
else<br />
{<br />
   m_dlg2->Create(IDD_DLG_VARIANCE, AfxGetMainWnd());<br />
	m_dlg2->ShowWindow(SW_SHOW);<br />
	m_dlg2->SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);<br />
	m_dlg2->CenterWindow();			<br />
	m_dlg2->UpdateWindow();<br />
	m_dlg2->RunModalLoop();<br />
}<br />


And to be a little more specific, one of the dialogs is for Purchase Orders, the 2nd for Invoices, and the 3rd is the Variance dialog(to display differences between the PO and corresponding Invoice).

modified on Monday, March 3, 2008 9:54 AM

GeneralRe: need a good method for popping between dialogs Pin
led mike29-Feb-08 11:16
led mike29-Feb-08 11:16 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude3-Mar-08 3:19
littleGreenDude3-Mar-08 3:19 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude3-Mar-08 4:20
littleGreenDude3-Mar-08 4:20 
GeneralRe: need a good method for popping between dialogs Pin
led mike3-Mar-08 7:26
led mike3-Mar-08 7:26 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude3-Mar-08 8:45
littleGreenDude3-Mar-08 8:45 
GeneralRe: need a good method for popping between dialogs Pin
led mike3-Mar-08 9:49
led mike3-Mar-08 9:49 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude4-Mar-08 3:13
littleGreenDude4-Mar-08 3:13 
GeneralRe: need a good method for popping between dialogs Pin
led mike4-Mar-08 5:49
led mike4-Mar-08 5:49 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude4-Mar-08 3:35
littleGreenDude4-Mar-08 3:35 
GeneralRe: need a good method for popping between dialogs Pin
led mike4-Mar-08 5:56
led mike4-Mar-08 5:56 
GeneralRe: need a good method for popping between dialogs Pin
littleGreenDude4-Mar-08 7:35
littleGreenDude4-Mar-08 7:35 
GeneralRe: need a good method for popping between dialogs Pin
led mike4-Mar-08 8:01
led mike4-Mar-08 8:01 
Generalchecking the current time in C++ Pin
nahitan29-Feb-08 9:02
nahitan29-Feb-08 9:02 
GeneralRe: checking the current time in C++ Pin
David Crow29-Feb-08 9:41
David Crow29-Feb-08 9:41 
GeneralRe: checking the current time in C++ Pin
nahitan29-Feb-08 10:15
nahitan29-Feb-08 10:15 
QuestionRe: checking the current time in C++ Pin
David Crow29-Feb-08 10:19
David Crow29-Feb-08 10:19 
GeneralRe: checking the current time in C++ Pin
Bram van Kampen29-Feb-08 12:39
Bram van Kampen29-Feb-08 12:39 

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.