CStringT::Tokenize  
Author Message
dtrenaman





PostPosted: Visual C++ General, CStringT::Tokenize Top

The behaviour of Tokenize has changed between MFC 7 and MFC 8 and has broken some of our existing code. The change has to do with passing in an empty ("") delimiter string. In MFC 7 Tokenize would return the original string AND adjust iStart so it was possible to use it in a while loop like so:

CString strDelimiters = "";

int iStart = 0;
CString strCurrentValue = strText.Tokenize(
strDelimiters, iStart);
while (strCurrentValue != "")
{
//DO SOME STUFF HERE

strCurrentValue = strText.Tokenize(strDelimiters, iStart);
}

With MFC 8 iStart is never adjusted so subsequent calls to Tokenize always returns the original string rather than returning an empty string like under MFC 7.

If any of the MFC team is listening I am wondering why you decided not adjust iStart and instead made passing an empty string the equivalent to passing NULL.

Thanks.




Visual C++8  
 
 
Bite Qiu - MSFT





PostPosted: Visual C++ General, CStringT::Tokenize Top

hi Dtrenaman,

re: CStringT::Tokenize

the more appropriate place for your question is probably the MFC newsgroup: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.vc.mfc&lang=en&cr=US

OTP

thanks

Bite