Design a form shown below to get input from users.
There should be three groups of radio buttons.
For each main radio button in a group,
don't forget to set its Group property to True.
To detect the state of the check box, you
need to call the member function
GetState()
and use the bitwise AND to get the value of the flag BSD_CHECKED as
follows:
In your CView class, you may declare a private data member m_str with
initial value _T("0000").
The first character indicates the college:
H - Humanity
E - Education
M - Management
S - Science and Technology
The second character indicates the gender:
1 - Male
2 - Female
The third character indicates the grade:
1 - Freshman
2 - Sophomore
3 - Junior
4 - Senior
The fourth character indicates whether the student agrees to
the proposition or not.
Y - agree
N - disagree
When the user clicks a radio button or the check box, the m_str
data member is updated, the shown in the edit box.
When the Clear button is clicked, all radio buttons and the check
box are reset.
When the Save button is clicked, the m_str is converted from
Unicode to ASCII code by the macro CT2A(), and appended to a file
"log.txt".
You may want to automatically call the OnBnClickedButtonClear() to reset
all radio buttons and the edit box.
The "log.txt" file can be found under the same directory as your
.cpp program. The path may be something like
"D:\VisualStudio2010\Projects\questionnaire\questionnaire".