Click here to Skip to main content
16,010,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Overwrite contents of a file Pin
dlarkin7710-Jan-05 10:25
dlarkin7710-Jan-05 10:25 
GeneralRe: Overwrite contents of a file Pin
Jörgen Sigvardsson10-Jan-05 13:18
Jörgen Sigvardsson10-Jan-05 13:18 
GeneralRe: Overwrite contents of a file Pin
gecool10-Jan-05 22:48
gecool10-Jan-05 22:48 
GeneralPrint Preview Pin
act_x10-Jan-05 7:53
act_x10-Jan-05 7:53 
GeneralAccessing/ updating document data in a separate class Pin
help_wanted10-Jan-05 7:11
help_wanted10-Jan-05 7:11 
GeneralRe: Accessing/ updating document data in a separate class Pin
act_x10-Jan-05 8:07
act_x10-Jan-05 8:07 
GeneralRe: Accessing/ updating document data in a separate class Pin
help_wanted10-Jan-05 8:37
help_wanted10-Jan-05 8:37 
GeneralRe: Accessing/ updating document data in a separate class Pin
Iain Clarke, Warrior Programmer10-Jan-05 8:21
Iain Clarke, Warrior Programmer10-Jan-05 8:21 
This will assume it is a modal dialog.

You mention needing to update the document, so
you need to add a command handler to the doc.

Either using ClassWizard, or manually, add
a command handler to the document.

BEGIN_MESSAGE_MAP(CMyDocument, CDocument)
...
ON_COMMAND(IDC_MYCOMMAND, OnMyCommand)
...
END_MESSAGE_MAP()

...

void CMyDocument::OnMyCommand)
{
    // Fill in stuff here.
}


You've already got a dialog box. I'll pretend
it has a few member variable that you store
data in.


void CMyDocument::OnMyCommand)
{
CMyDialog dlg (AfxGetMainWnd ()); // Make the dialog a child of the application window - doc don't have one.

dlg.m_bFlagOfSomeKind = FLAG_FOO | FLAG_BAR;
dlg.m_nVariable = m_nVariable; // Copy over a variable from the doc.

if (dlg.DoModal () != IDOK) // Do the dialog.
return;

// Use the results.
m_nVariable = dlg.m_nVariable.
m_nOtherVar = dlg.m_nResultData;

UpdateAllView (); // Sync view(s) with new contents of document.
}


Done!

Iain.
GeneralRe: Accessing/ updating document data in a separate class Pin
help_wanted10-Jan-05 8:36
help_wanted10-Jan-05 8:36 
GeneralRe: Accessing/ updating document data in a separate class Pin
Iain Clarke, Warrior Programmer10-Jan-05 9:50
Iain Clarke, Warrior Programmer10-Jan-05 9:50 
GeneralFileTimeToSystemTime question Pin
Shay Harel10-Jan-05 7:00
Shay Harel10-Jan-05 7:00 
GeneralRe: FileTimeToSystemTime question Pin
basementman10-Jan-05 7:21
basementman10-Jan-05 7:21 
GeneralRe: FileTimeToSystemTime question Pin
Shay Harel10-Jan-05 8:57
Shay Harel10-Jan-05 8:57 
GeneralConversion class Pin
Renjith Ramachandran10-Jan-05 6:43
Renjith Ramachandran10-Jan-05 6:43 
GeneralRe: Conversion class Pin
act_x10-Jan-05 8:03
act_x10-Jan-05 8:03 
GeneralRe: Conversion class Pin
PJ Arends10-Jan-05 8:44
professionalPJ Arends10-Jan-05 8:44 
GeneralRe: Conversion class Pin
David Crow11-Jan-05 10:31
David Crow11-Jan-05 10:31 
GeneralTAO Corba (Visual Studio) Pin
sweep12310-Jan-05 6:22
sweep12310-Jan-05 6:22 
GeneralProblem with XP! Pin
Lazzari Patrizio10-Jan-05 5:50
Lazzari Patrizio10-Jan-05 5:50 
GeneralRe: Problem with XP! Pin
Iain Clarke, Warrior Programmer10-Jan-05 8:26
Iain Clarke, Warrior Programmer10-Jan-05 8:26 
GeneralRe: Problem with XP! Pin
Lazzari Patrizio10-Jan-05 21:00
Lazzari Patrizio10-Jan-05 21:00 
GeneralRe: Problem with XP! Pin
Iain Clarke, Warrior Programmer11-Jan-05 0:58
Iain Clarke, Warrior Programmer11-Jan-05 0:58 
GeneralRe: Problem with XP! Pin
Lazzari Patrizio11-Jan-05 1:15
Lazzari Patrizio11-Jan-05 1:15 
GeneralRe: Problem with XP! Pin
Antony M Kancidrowski11-Jan-05 2:10
Antony M Kancidrowski11-Jan-05 2:10 
GeneralRe: Problem with XP! Pin
Iain Clarke, Warrior Programmer11-Jan-05 2:45
Iain Clarke, Warrior Programmer11-Jan-05 2:45 

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.