|
Why isn't it possible? I was anxious, because I was a beginner and couldn't adjust it for a few days.
Which hero helped me look at my program
CString str = "a # bc # dfgh # e";
CString str1, str2, str3, str4;
CStringArray StrArray;
void CMy30Dlg :: dispach ()
{
AfxExtractSubString (str1, str, 0, '#'); / str1 = "a"
AfxExtractSubString (str2, str, 0, '#'); / str2 = "bc"
AfxExtractSubString (str3, str, 0, '#'); / str3 = "dfgh"
AfxExtractSubString (str4, str, 0, '#'); / str4 = "e"
Ranch
StrArray.Add (str1);
StrArray.Add (str2);
StrArray.Add (str3);
StrArray.Add (str4);
}
// I took the strings separated by # signs, put them in str1, str2, str3, str4, and put them in StrArray
void CMy30Dlg :: display ()
{
UpdateData ();
m_fre = StrArray.GetAt (1);
m_bw = StrArray.GetAt (2);
m_sen = StrArray.GetAt (3);
m_hop = StrArray.GetAt (4);
UpdateData (false);
}
// m_fre, m_bw, m_sen, m_hop are the four CString variables that I associate with the Edit control. In this function, I want to display the four saved characters in the four edit edit boxes.
What's wrong ????
Anxious! Thank you |
|