Re: initialize text box
From: GuitarBill (GuitarBill_at_cox_dot_net)
Date: 07/22/04
- Next message: dom: "Re: Compiling MFC with UNICODE problem"
- Previous message: BRM: "Re: Dialog generating Assertion on exit of program..."
- In reply to: Gerd Keller: "Re: initialize text box"
- Next in thread: Joseph M. Newcomer: "Re: initialize text box"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 13:58:48 -0700
If you assign the value in the constructor:
CMyDlg::CMyDlg(CWnd* pParent /*=NULL*/) : CDialog(CMyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFontCreateDlg)
m_value = 1234;
//}}AFX_DATA_INIT
}
or if you assign it in OnInitDialog, before the base class:
BOOL CMyDlg::OnInitDialog()
{
m_value = 1234;
CDialog::OnInitDialog();
return TRUE;
}
In either case you do not need to call UpdateData() (this effectively
happens inside CDialog::OnInitDialog()).
Bill
"Gerd Keller" <Gerd.Keller@smail.inf.fh-bonn-rhein-sieg.de> wrote in message
news:uN4i60$bEHA.2292@TK2MSFTNGP09.phx.gbl...
>
> Hello,
>
> The UpdateData(FALSE) aproach worked for me!
>
> I have read somewhere that using UpdateData(FALSE) is no nice MFC Style
> -anyway I use it only once for initialization
>
> I can not find the AFX_DATA_INIT section of my parent window. W
> I am using a Dialog based Application.
>
> >
> > best regards,
> > gerd
> >
> >
>
>
- Next message: dom: "Re: Compiling MFC with UNICODE problem"
- Previous message: BRM: "Re: Dialog generating Assertion on exit of program..."
- In reply to: Gerd Keller: "Re: initialize text box"
- Next in thread: Joseph M. Newcomer: "Re: initialize text box"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|