Click here to Skip to main content
15,887,135 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing CDialog when it looses the focus Pin
msn9211-Oct-09 10:35
msn9211-Oct-09 10:35 
GeneralRe: Closing CDialog when it looses the focus Pin
Joe Woodbury11-Oct-09 10:46
professionalJoe Woodbury11-Oct-09 10:46 
GeneralRe: Closing CDialog when it looses the focus Pin
David Crow11-Oct-09 16:50
David Crow11-Oct-09 16:50 
GeneralRe: Closing CDialog when it looses the focus Pin
Iain Clarke, Warrior Programmer11-Oct-09 20:37
Iain Clarke, Warrior Programmer11-Oct-09 20:37 
GeneralRe: Closing CDialog when it looses the focus Pin
msn9213-Oct-09 15:18
msn9213-Oct-09 15:18 
GeneralRe: Closing CDialog when it looses the focus Pin
Iain Clarke, Warrior Programmer13-Oct-09 21:28
Iain Clarke, Warrior Programmer13-Oct-09 21:28 
GeneralRe: Closing CDialog when it looses the focus Pin
msn9217-Oct-09 7:29
msn9217-Oct-09 7:29 
GeneralRe: Closing CDialog when it looses the focus Pin
Iain Clarke, Warrior Programmer17-Oct-09 7:48
Iain Clarke, Warrior Programmer17-Oct-09 7:48 
OK, I'll assume you have a small idea about classes, dialog, and dodataexchange. If not, go create some and get an idea!

What I meant was similar to...

struct Options
{
   double xmin;
   ...
};

class CMyApp
{
...
   Options m_Options;
...
};

In your main frame, you have a menu handler:
void CMainFrame::OnToolsOptions ()
{
   CMyOptionsDlg *pDlg = new CMyOptionsDlg; // make a new options dlg - it will self delete.
   CMyApp *pApp = (CMyApp *) AfxGetApp ();
   dlg->m_pOptions = &(pApp->m_Options); // give the dialog a pointer to the options struct.

   dlg->Create (this);  // make the dialog window
}

void COptionDlg::DoDataExchange (CDataExchange *pDX)
{
   ASSERT(m_pOtions);
   if (!m_pOptions) return;

   // get/set a double from an edit box
   DDX_Text (pDX, IDC_XMIN, m_pOptions->xmin);
   ...
}


I hope those snippets gave you a better idea of what I was thinking!

Iain.

I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]

GeneralRe: Closing CDialog when it looses the focus Pin
msn9231-Oct-09 19:41
msn9231-Oct-09 19:41 
Questioncreating limited objects Pin
p_196011-Oct-09 3:15
p_196011-Oct-09 3:15 
AnswerRe: creating limited objects Pin
wangningyu11-Oct-09 4:54
wangningyu11-Oct-09 4:54 
GeneralRe: creating limited objects Pin
CPallini11-Oct-09 10:59
mveCPallini11-Oct-09 10:59 
RantRe: creating limited objects PinPopular
Iain Clarke, Warrior Programmer11-Oct-09 5:27
Iain Clarke, Warrior Programmer11-Oct-09 5:27 
AnswerRe: creating limited objects Pin
Rajesh R Subramanian11-Oct-09 5:42
professionalRajesh R Subramanian11-Oct-09 5:42 
GeneralRe: creating limited objects Pin
CPallini11-Oct-09 11:01
mveCPallini11-Oct-09 11:01 
AnswerRe: creating limited objects [modified] Pin
Richard MacCutchan11-Oct-09 6:00
mveRichard MacCutchan11-Oct-09 6:00 
AnswerRe: creating limited objects Pin
David Crow11-Oct-09 16:43
David Crow11-Oct-09 16:43 
QuestionSmart card reader SLE4418_28 And SDI010 Pin
tanukochhar1811-Oct-09 2:39
tanukochhar1811-Oct-09 2:39 
QuestionReference question in C++ [modified] Pin
es196811-Oct-09 1:19
es196811-Oct-09 1:19 
AnswerRe: Reference question in C++ Pin
CPallini11-Oct-09 2:22
mveCPallini11-Oct-09 2:22 
GeneralRe: Reference question in C++ Pin
es196811-Oct-09 6:41
es196811-Oct-09 6:41 
GeneralRe: Reference question in C++ Pin
Rajesh R Subramanian11-Oct-09 7:29
professionalRajesh R Subramanian11-Oct-09 7:29 
GeneralRe: Reference question in C++ Pin
es196811-Oct-09 11:55
es196811-Oct-09 11:55 
GeneralRe: Reference question in C++ Pin
CPallini11-Oct-09 8:13
mveCPallini11-Oct-09 8:13 
GeneralRe: Reference question in C++ Pin
es196811-Oct-09 11:54
es196811-Oct-09 11:54 

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.