Re: initialize text box

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: GuitarBill (GuitarBill_at_cox_dot_net)
Date: 07/22/04


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
> >
> >
>
>



Relevant Pages

  • Re: Create objects using dynamic class names
    ... classes from a common base class and have an array of class references ... Not necessarily an open array, although that neatly coalesces the steps ... The constructor of the base class can only construct an instance of the ... TPageClass = class of TPage; ...
    (comp.lang.pascal.delphi.misc)
  • Re: Create objects using dynamic class names
    ... classes from a common base class and have an array of class references ... Not necessarily an open array, although that neatly coalesces the steps ... The constructor of the base class can only construct an instance of the ... TPageClass = class of TPage; ...
    (comp.lang.pascal.delphi.misc)
  • Re: What does the CLR do when you instantiate an object? - Continue
    ... I did think about looking at the rotor source but the original question ... asked was meant for the MS CLR not another implementation. ... > the complier will automaticaly insert the defaut constructor in the IL ... > The CLR WILL NOT call the base class automatically for you. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Factory method
    ... The base class must not create the children. ... If you don't want a public constructor, then define a Factory ... >I have an abstract class, and a set of classes that inherit from my ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Am I missing something in private inheritance?
    ... >> virtual base class is public, ... > constructor, I do not know. ... > class SomeClass: Sealed ... decides to change public inheritance to private. ...
    (comp.lang.cpp)