- Add
member Varaiables.
- On
the View menu, click ClassWizard.
The MFC
ClassWizard
dialog box appears, click
the Member Variables
tab.
Note:
This tab, contains a list
box displaying the
mapping between controls
and member variables.
- In
the Class name box,
select the class CTestVC0Dlg.
- Select
the name of the Control
ID you want to
add a variable - IDC_
BOOK.
- Click
Add Variable, the Add
Member Variable
dialog box appears.
- In
the Member variable
name text box, type
the name of the variable
- m_book.
- In
the Category drop-down
list, select the
appropriate type of
variable - Value.
- In
the Variable type drop-down
list, select the
appropriate class that
defines the
variable's data type - CString.
- Click
OK.
Note:
The member name and type
you specified now appear
in the Control IDs
list.
Repeat
steps 3 through to 8 to
add a member Variable for
other controls:
Control
IDs |
Member
Variable name |
Category
|
Variable
Type |
IDC_TITLE
IDC_CHAPTER
IDC_VERSE
IDC_TEXTDATA... |
m_title
m_chapter
m_verse
m_textdata |
Value
Value
Value
Value |
CString
CString
CString
CString |
|
|
- ClassWizard makes
changes to TestVC0Dlg.h
and TestVC0Dlg.cpp files
after you’ve mapped
the controls to member variables. Examine
these changes, click
here.
- Save this
application.
Run it, from Build
menu, choose and click Execute
TestVC0.exe.
|