mfc >> Updating dialog controls

by Claude Gagnon » Sun, 30 Nov 2003 00:36:28 GMT

Hi,

I have a SDI application written with Visual C++ 6.

The view is a CFormView. The first dialog in the CFormView has CTabCtrl to
switch between dialogs.

When I open a file, I want that the data ,in this file, to be put in the
differents controls of all of the dialogs.
But I don't know how to do this.

I think I have to do this in the CFormView OnUpdate member function. I have
tried also mTab.UpdateData(FALSE), but without success.

Does anyone has suggestions ?

Thanks,

Claude





mfc >> Updating dialog controls

by Scott McPhillips [MVP] » Sun, 30 Nov 2003 00:53:12 GMT





You should add a function to each tab page dialog to put the data in its
own controls. Call each of these functions from CFormView OnUpdate.
OnUpdate can access the document and read each individual data item from
document variables, or it could simply pass the document pointer to the
dialog functions so they can access the document data they need.

--
Scott McPhillips [VC++ MVP]




mfc >> Updating dialog controls

by Claude Gagnon » Sun, 30 Nov 2003 04:04:53 GMT

Hi Scott,

Thanks for your answer.

It helps me and I have found the solution.

Bye,

Claude

"Scott McPhillips [MVP]" < XXXX@XXXXX.COM > a rit dans le message


to
the
have




Similar Threads

1. How should I update a static Control in a dialog from a worker

2. How should I update a static Control in a dialog from a worker thr

I would like to update static text on the screen which has been changed by a 
worker thread but if I call a function in a dialog box, that uses UpdateData, 
from the worker thread there the programme crashes.  I've used Progress bars 
like this before. why doesn't it work with the statics text control? How 
should I achieve this?

Cheers

Grant

3. Updating A Progress Control in a MFC Dialog From a Worker Thread

4. dialog controls breaking dialog box...

I'm trying to create a dialog box that pops when a menu item is selected, and it works fine unless I put certain controls in the dialog box.  I tried a month calendar, slider, and a date time picker, and with these controls the dialog box doesn't appear when I select the menu item.  However, if I delete those controls from the dialog box, and just have buttons, it appears fine.  Any ideas?  Thanks in advance

NH

5. modelss ATL dialog doesn't display dialog controls

6. Control on Dialog bar vs. Modal Dialog

When I place a control on a Modal Dialog, I can get access to it's messages
and controls.

When I put the same control on a Dialog Bar, messages don't seem to be
passed through to the underlying class (which is identical in both cases).

Any hint? What is the major difference in these two cases? Can I use the
DDX/DDV tools for dialogs that are on a Dialog Bar?

 --- stefkeB ---


7. Accessing a dialogs controls from different a dialog

8. Display one dialog image in another dialog Picture control

Hi All,
I have created a MFC Dialog based application and I have added a
picture control on it.
Now I have inserted another Dialog Resource from menu Insert ->
Resource -> Dialog-> New.
For the newly inserted Dialog, I have created a class
CFirstDialogPage. And I have added a picture control and added the
bitmap on the picture control.

Now I want show the Second dialog bitmap on the First Dialog Picture
control but I am unable to do that.
I have written the code like below in the First Dialog Ok button



void CTestingDlg::OnOK()
{

  CRect rect;
  CStepOnePage *pPage = new CStepOnePage();

  	if (pPage->Create(IDD_DIALOG1, this) == FALSE) ;
//IDD_DIALOG1 is the Newly created Dialog ID

  CWnd *pWnd = GetDlgItem(IDC_SHEETRECT);
//IDC_SHEETRECT is the Picture control ID of the MainDialog(First
Application Dailog)
  ASSERT(pWnd != NULL);
  ASSERT(IsWindow(pWnd->m_hWnd) != FALSE);

  pWnd->GetWindowRect(&rect);
  pPage->ScreenToClient(&rect);
  pPage->SetWindowPos(NULL, rect.left, rect.top, 0, 0,
				SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );
				pPage->EnableWindow(TRUE);

  pPage->ShowWindow(SW_SHOW);
  pPage->InvalidateRect(NULL);
  pPage->UpdateWindow();
  //CDialog::OnOK();
}

But by this displaying the Second dialog but as individual
but i want to render the second dialog in the first Dialog but not as
a separate dialog (means Second dialog will be merged as a part of the
first dialog)


Thanks in advance.
Regards
Rasheed.