CString selectedModel;
m_ListBoxOfConnection.GetText(sel, selectedModel);
//selectedModel = "com1,model1,base";
CString comStr;
CString modelStr;
CString optionStr;
AfxExtractSubString(comStr, selectedModel, 0, ',');
AfxExtractSubString(modelStr, selectedModel, 1, ',');
AfxExtractSubString(optionStr, selectedModel, 2, ',');
//then
//comStr = com1
//modelStr = model1
//optionStr = base
Thank you.
This comment has been removed by a blog administrator.
ReplyDeleteThis is explained on the condition that CString is used.
ReplyDeleteIf input string is "aaa,bbb,ccc" and we want to split based on ','
we can use AfxExtractionString function.
Like that
AfxExtractSubString(comStr, selectedModel, 0, ',');
AfxExtractSubString(modelStr, selectedModel, 1, ',');
AfxExtractSubString(optionStr, selectedModel, 2, ',');
Then each string is stored like that
comStr -> com1
modelStr -> model1
optionStr -> base
Thank you.
I found a lot of information here to create this actually best for all newbie here. Thank you for this information. Online Tik Tok Viewer
ReplyDelete