6/19/2017

tip, CString token in MFC

refer to below code.


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.



No comments:

Post a Comment