Re: Structure of MFC
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 03/03/04
- Next message: Ali R.: "Re: CDialog and CView ?"
- Previous message: Ajay Kalra: "Re: Working on Excel from VC++"
- In reply to: CJ`: "Re: Structure of MFC"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 03 Mar 2004 10:57:54 -0500
You declare the variables where they are needed. You initialize them at the point where it
is appropriate. It's just programming.
For example, if you have a CList that is used by your dialog, you declare it in the
(typically protected) section of your dialog class, and you most often initialize it in
the OnInitDialog handler for that dialog. Unless there is a reason to initialize it later,
or earlier (e.g., it is public and is used to pass information IN to your dialog).
Otherwise, I agree with the answer below. You don't generate header files for your
MFC-based classes such as your dialog, that's why AppWizard and ClassWizard exist. To
declare classes of your own, put them in header files you create. It's just programming.
joe
On Wed, 3 Mar 2004 06:21:05 -0800, CJ` <anonymous@discussions.microsoft.com> wrote:
>Thanx a lot for the information, Kusuma..............
>
>Well i thought so but i would like to know is
> 1. I would like to initialise data structures llike Arrays ,Lists.....
> where do i initialise and define them????
>
>Regards
>
> ----- kusuma wrote: -----
>
> Hi,
>
> When you are using an MFC based application, you need not create any header
> files or cpp files if u select a dialogbased application. A header file and
> your application specific dialog.cpp file will be generated automatically.
> You will go through a wizard while creating a dialog based application.You
> need to write functions for the particular events which u want like
> OnButtonDoubleClick or for any common control events once you place them on
> the dialog box from the resource editor.
>
> Regards,
> Kusuma.
>
> "CJ`" <anonymous@discussions.microsoft.com> wrote in message
> news:C047C631-9E7F-4F1B-A2E1-E658C12CE174@microsoft.com...
> > hi
> > I would like to develop an MFC based application.I would like to know
> >> 1. Where & How do i declare the classes,structures i use.
> > 2.Do i have to create header files & .cpp classes as well as new user
> defined functions or can i
> > se the existing MFC based classes..& headers created automatically on
> selecting a
> > DIALOG based appln.
> >
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: Ali R.: "Re: CDialog and CView ?"
- Previous message: Ajay Kalra: "Re: Working on Excel from VC++"
- In reply to: CJ`: "Re: Structure of MFC"
- Messages sorted by: [ date ] [ thread ]