I have this struct
definition:
typedef struct tagPublicTalkInfo
{
CString strAwayCong1;
CString strAwayCong2;
CString strAwayBrother1;
CString strAwayBrother2;
CString strChairman;
CString strCong;
CString strHosp;
CString strReader;
CString strBrother;
CString strTheme;
CString strWTConductor;
CString strInterpreter;
CString strMisc;
CString strWatchtowerStudyTheme;
CString strServiceTalkTheme;
CString strBibleVersesReader;
CString strVideoHost;
CString strVideoCohost;
CString strOpeningPrayer;
CString strClosingPrayer;
int iSongStart;
int iSongMiddle;
int iSongEnd;
int iThemeNumber;
} S_TALK_INFO;
This structure is passed into a dialog and retrieved like this:
void CWeekendMeetingDlg::SetWeekendMeetingInfo(S_TALK_INFO &rsTalkInfo)
{
m_sWeekendMeetingInfo = rsTalkInfo;
}
S_TALK_INFO CWeekendMeetingDlg::GetWeekendMeetingInfo()
{
return m_sWeekendMeetingInfo;
}
At the moment I am mapping the dialog controls to distinct variables and transfer to / from my structure. For example:
m_strChairman = m_sWeekendMeetingInfo.strChairman;
m_sWeekendMeetingInfo.strChairman = m_strChairman;
Is possible to map my controls directly to the structure member CString
variables or would that be considered bad practice?